View generate_single_header.bat
This file contains 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 |
View Open with Sublime Merge.reg
This file contains 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" |
View demo.py
This file contains 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!") |
View DeserializeFromRam.ino
This file contains 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; | |
} |
View github-pages.yml
This file contains 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 |
View celery_task_failure_email.py
This file contains 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} |
View proxy_response.py
This file contains 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) |
View example.py
This file contains 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')) |
View settings.json
This file contains 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
{ | |
"cmake.buildDirectory": "${env:TEMP}/vscode_cmake/${workspaceFolderBasename}" | |
} |
View slideshow.sh
This file contains 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
magick \ | |
\( -delay 100 image-00.png \) \ | |
\( -delay 10 image-00.png image-01.png -morph 3 -delete 0 \) \ | |
\( -delay 100 image-01.png \) \ | |
\( -delay 10 image-01.png image-02.png -morph 3 -delete 0 \) \ | |
\( -delay 100 image-02.png \) \ | |
\( -delay 10 image-02.png image-03.png -morph 3 -delete 0 \) \ | |
\( -delay 100 image-03.png \) \ | |
\( -delay 10 image-03.png image-04.png -morph 3 -delete 0 \) \ | |
\( -delay 200 image-04.png \) \ |
NewerOlder