This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "agent": { | |
| "metrics_collection_interval": 60 | |
| }, | |
| "metrics": { | |
| "namespace": "CWAgent", | |
| "append_dimensions": { | |
| "InstanceId": "${aws:InstanceId}" | |
| }, | |
| "metrics_collected": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| docker run -it --rm -v %CD%:/data python:2 python /data/scripts/generateSingleHeader.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Windows Registry Editor Version 5.00 | |
| [HKEY_CLASSES_ROOT\Directory\shell\smerge] | |
| ; %PROGRAMFILES%\Sublime Merge\sublime_merge.exe | |
| "Icon"=hex(2):25,00,50,00,52,00,4f,00,47,00,52,00,41,00,4d,00,46,00,49,00,4c,\ | |
| 00,45,00,53,00,25,00,5c,00,53,00,75,00,62,00,6c,00,69,00,6d,00,65,00,20,00,\ | |
| 4d,00,65,00,72,00,67,00,65,00,5c,00,73,00,75,00,62,00,6c,00,69,00,6d,00,65,\ | |
| 00,5f,00,6d,00,65,00,72,00,67,00,65,00,2e,00,65,00,78,00,65,00,00,00 | |
| @="Open with Sublime Merge" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from halo_nestable import HaloNestable | |
| import time | |
| with HaloNestable("Top level") as spinner: | |
| time.sleep(2) | |
| with HaloNestable("Nested"): | |
| time.sleep(2) | |
| time.sleep(2) | |
| spinner.succeed("Great success!") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // https://github.com/bblanchon/ArduinoJson/issues/1593 | |
| #include <ArduinoJson.h> | |
| void setup() { | |
| // Initialize serial port | |
| Serial.begin(115200); | |
| while (!Serial) continue; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and deploy Jekyll site to GitHub Pages | |
| on: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| github-pages: | |
| runs-on: ubuntu-latest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from celery.signals import task_failure | |
| from django.core.mail import mail_admins | |
| from pprint import pformat | |
| @task_failure.connect | |
| def celery_task_failure_email(task_id, sender, exception, einfo, *args, **kwargs): | |
| mail_admins( | |
| f"ERROR: Task {sender.name} raised {exception.__class__.__name__}", | |
| f"""Task {sender.name} with id {task_id} raised exception: | |
| {exception!r} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| from django.http import StreamingHttpResponse | |
| class ProxyHttpResponse(StreamingHttpResponse): | |
| def __init__(self, url, headers=None, **kwargs): | |
| upstream = requests.get(url, stream=True, headers=headers) | |
| kwargs.setdefault('content_type', upstream.headers.get('content-type')) | |
| kwargs.setdefault('status', upstream.status_code) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from django.db.models import OuterRef | |
| weapons = Weapon.objects.filter(unit__player_id=OuterRef('id')) | |
| units = Unit.objects.filter(player_id=OuterRef('id')) | |
| qs = Player.objects.annotate(weapon_count=SubqueryCount(weapons), | |
| rarity_sum=SubquerySum(units, 'rarity')) |
NewerOlder