Skip to content

Instantly share code, notes, and snippets.


Michael Floering hangtwenty

Block or report user

Report or block hangtwenty

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
antony / index.html
Last active Mar 27, 2020
Svelte App on Older Browsers (IE11+)
View index.html
<!-- generated via npm run build && npx create-polyfill-service-url analyse --file public/bundle.js -->
<script crossorigin="anonymous" src=",Array.isArray,Array.prototype.entries,Array.prototype.fill,Array.prototype.filter,Array.prototype.forEach,Array.prototype.indexOf,Array.prototype.keys,,ArrayBuffer,console,DataView,Date.prototype.toISOString,document,fetch,Function.prototype.bind,globalThis,Map,Object.create,Object.defineProperties,Object.defineProperty,Object.entries,Object.getOwnPropertyDescriptor,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.getPrototypeOf,Object.keys,Object.setPrototypeOf,Promise,Reflect,Reflect.construct,Set,Symbol,Symbol.iterator,WeakMap,WeakSet"></script>
WillEccles / alfred-kitty.scpt
Last active Mar 30, 2020
AppleScript for using Kitty in Alfred. This was made for bash, but can easily be made to work with any shell.
View alfred-kitty.scpt
(* 2019-06-07: Added nohup and output redirection to fix a bug with "Open Terminal here" feature.
Thanks to @fools-mate for bringing the issue to my attention. *)
on alfred_script(q)
do shell script "cd ~; nohup /Applications/ /bin/bash -c \"source ~/.bashrc && " & q & ";/bin/bash\" > /dev/null 2>&1 &"
end alfred_script
Rich-Harris /
Last active Mar 30, 2020
The truth about Svelte

I've been deceiving you all. I had you believe that Svelte was a UI framework — unlike React and Vue etc, because it shifts work out of the client and into the compiler, but a framework nonetheless.

But that's not exactly accurate. In my defense, I didn't realise it myself until very recently. But with Svelte 3 around the corner, it's time to come clean about what Svelte really is.

Svelte is a language.

Specifically, Svelte is an attempt to answer a question that many people have asked, and a few have answered: what would it look like if we had a language for describing reactive user interfaces?

A few projects that have answered this question:

codecitizen / serverless.yml
Created Nov 22, 2018
A serverless.yml file configuring a AWS ElastiCache redis instance that is accessible by all AWS Lambda functions deployed by this serverless function.
View serverless.yml
service: my-service
name: aws
runtime: nodejs8.10
stage: ${opt:stage, 'dev'}
"Fn::GetAtt": [ElasticCacheCluster, RedisEndpoint.Address]
View kube-aliases.bash
k() {
command kubectl --namespace="${_kube_ns:-default}" $@
alias kgp='k get pods'
alias kgs='k get svc'
alias kgn='k get ns'
kubectl() {
k "$@"
ngtvspc /
Created Jan 9, 2018
Remove EXIF metadata from images
# Uses the Python Imaging Library
# `pip install Pillow` works too
from PIL import Image
image_filename = "picture_with_EXIF.jpg"
image_file = open('image_filename)
image =
# next 3 lines strip exif
image_data = list(image.getdata())
ipmb /
Last active Jan 28, 2020
Django logging example
import logging.config
import os
from django.utils.log import DEFAULT_LOGGING
# Disable Django's logging setup
LOGLEVEL = os.environ.get('LOGLEVEL', 'info').upper()
slavafomin /
Last active Jan 31, 2020
Git submodules best practices

Git submodules best practices

Useful commands

— Clone repository with submodules automatically:

git clone --recursive

— Initialize submodules after regular cloning:

jcrist /
Created Mar 15, 2017
Simple visualization of dask graph pipelines.
import os
import graphviz
from dask.optimize import key_split
from import _get_display_cls
from dask.core import get_dependencies
def node_key(s):
if isinstance(s, tuple):
jsonmaur / bzexcluderules_editable.xml
Last active Oct 9, 2019
Backblaze Custom Exclude
View bzexcluderules_editable.xml
<excludefname_rule plat="mac" osVers="*" ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/.git/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" />
<excludefname_rule plat="mac" osVers="*" ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/node_modules/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" />
You can’t perform that action at this time.