Skip to content

Instantly share code, notes, and snippets.


Serg Hospodarets malyw

View GitHub Profile
malyw /
Last active May 2, 2017
Remove Git branches, which are merged to the current one (+ ability to exclude some of them)
#!/usr/bin/env bash
# based on
# list
git branch -r --merged | grep origin | grep -v '>' | grep -v master\* | grep -v release-\* | xargs -L1
# delete
git branch -r --merged | grep origin | grep -v '>' | grep -v master\* | grep -v release-\* | xargs -L1 | awk '{sub(/origin\//,"");print}' | xargs git push origin --delete
malyw /
Last active May 2, 2017
Delete all the local Git branches except the current one
#!/usr/bin/env bash
git branch | grep -v (git rev-parse --abbrev-ref HEAD) | xargs git branch -D
Rich-Harris /
Last active Aug 11, 2020
Top-level `await` is a footgun

Edit — February 2019

This gist had a far larger impact than I imagined it would, and apparently people are still finding it, so a quick update:

  • TC39 is currently moving forward with a slightly different version of TLA, referred to as 'variant B', in which a module with TLA doesn't block sibling execution. This vastly reduces the danger of parallelizable work happening in serial and thereby delaying startup, which was the concern that motivated me to write this gist
  • In the wild, we're seeing (async main(){...}()) as a substitute for TLA. This completely eliminates the blocking problem (yay!) but it's less powerful, and harder to statically analyse (boo). In other words the lack of TLA is causing real problems
  • Therefore, a version of TLA that solves the original issue is a valuable addition to the language, and I'm in full support of the current proposal, which you can read here.

I'll leave the rest of this document unedited, for archaeological

darcyliu / .htaccess
Last active Sep 2, 2018
Apache GZIP compression and Expires headers
View .htaccess
<IfModule mod_deflate.c>
# Enabling Compression
SetOutputFilter DEFLATE
# Insert filters
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
jonathantneal /
Last active May 22, 2020
Local SSL websites on macOS Sierra

Local SSL websites on macOS Sierra

These instructions will guide you through the process of setting up local, trusted websites on your own computer.

These instructions are intended to be used on macOS Sierra, but they have been known to work in El Capitan, Yosemite, Mavericks, and Mountain Lion.

NOTE: You may substitute the edit command for nano, vim, or whatever the editor of your choice is. Personally, I forward the edit command to Sublime Text:

alias edit="/Applications/Sublime\"
malyw / Native JavaScript promises API
Last active Sep 26, 2016
Description of the native JavaScript promises API with examples
View Native JavaScript promises API
// Current browser support for native promises:
// Article:
// Polyfills:
/*------------------------------ GET PROMISE ------------------------------*/
// N.B.: Promises pass only first argument to resolve/reject callbacks, others are ignored
function doSomething(){
return new Promise(function(resolve, reject) {
wbroek / genymotionwithplay.txt
Last active Aug 8, 2020
Genymotion with Google Play Services for ARM
View genymotionwithplay.txt
NOTE: Easier way is the X86 way, described on
Download the following ZIPs:
ARM Translation Installer v1.1 (
Download the correct GApps for your Android version:
Google Apps for Android 6.0 ( -
Google Apps for Android 5.1 ( -
Google Apps for Android 5.0 ( -
fabiofl / gist:5873100
Created Jun 27, 2013
Clear Mac OS X's icon cache.
View gist:5873100
sudo find /private/var/folders/ -name -exec rm {} \;
dypsilon /
Last active Aug 7, 2020
A badass list of frontend development resources I collected over time.
getify / gist:2926699
Created Jun 13, 2012
non-rectangular (line and circle) clears in canvas
View gist:2926699
To see a demo of these in use, check out:
Example uses:
You can’t perform that action at this time.