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
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="https://cdn.polyfill.io/v3/polyfill.min.js?features=Array.from,Array.isArray,Array.prototype.entries,Array.prototype.fill,Array.prototype.filter,Array.prototype.forEach,Array.prototype.indexOf,Array.prototype.keys,Array.prototype.map,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
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/kitty.app/Contents/MacOS/kitty /bin/bash -c \"source ~/.bashrc && " & q & ";/bin/bash\" > /dev/null 2>&1 &"
end alfred_script
@Rich-Harris
Rich-Harris / what-is-svelte.md
Last active Mar 30, 2020
The truth about Svelte
View what-is-svelte.md

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
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
provider:
name: aws
runtime: nodejs8.10
stage: ${opt:stage, 'dev'}
environment:
REDIS_HOST:
"Fn::GetAtt": [ElasticCacheCluster, RedisEndpoint.Address]
functions:
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
ngtvspc / EXIF_remover.py
Created Jan 9, 2018
Remove EXIF metadata from images
View EXIF_remover.py
# 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 = Image.open(image_file)
# next 3 lines strip exif
image_data = list(image.getdata())
@ipmb
ipmb / settings.py
Last active Jan 28, 2020
Django logging example
View settings.py
import logging.config
import os
from django.utils.log import DEFAULT_LOGGING
# Disable Django's logging setup
LOGGING_CONFIG = None
LOGLEVEL = os.environ.get('LOGLEVEL', 'info').upper()
logging.config.dictConfig({
@slavafomin
slavafomin / git-submodules.md
Last active Jan 31, 2020
Git submodules best practices
View git-submodules.md

Git submodules best practices

Useful commands

— Clone repository with submodules automatically:

git clone --recursive git@github.com:name/repo.git

— Initialize submodules after regular cloning:

@jcrist
jcrist / vis.py
Created Mar 15, 2017
Simple visualization of dask graph pipelines.
View vis.py
import os
import graphviz
from dask.optimize import key_split
from dask.dot import _get_display_cls
from dask.core import get_dependencies
def node_key(s):
if isinstance(s, tuple):
@jsonmaur
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.