Skip to content

Instantly share code, notes, and snippets.

@coaxial
coaxial / .js
Last active September 29, 2015 13:18 — forked from joepie91/.js
Promise flattening
Promise.try(function(){
return outerThingOne();
}).then(function(value){
return Promise.try(function(){
return innerThingOne();
}).then(function(subValue){
return innerThingTwo(subValue);
});
}).then(function(result){
return outerThingThree(result);
@coaxial
coaxial / .txt
Last active October 28, 2015 01:59
Chrome dev tools
console.assert(true === false)
prints an error if assertion is false
$(el)
will find elements, built-in. may be overridden by jQuery
inspect($(el))
focuses dev tools on el
$n
history of last selections where $0 is the last selection, $1 the one before that etc
@coaxial
coaxial / update_stock_rooted_nexus5.md
Last active July 17, 2016 01:16
Nexus 5 rooted stock Marshmallow update procedure
@coaxial
coaxial / gist:268c4198d09c2a712387
Created February 22, 2016 20:51
esp8266 types
Platform: espressif
---------------------------------------------------------------------------------------------------------------------
Type MCU Frequency Flash RAM Name
---------------------------------------------------------------------------------------------------------------------
huzzah esp8266 80Mhz 4096kB 80kB Adafruit HUZZAH ESP8266
esp_wroom_02 esp8266 80Mhz 4096kB 50kB ESP-WROOM-02
espduino esp8266 80Mhz 4096kB 80kB ESPDuino (ESP-13 Module)
espino esp8266 80Mhz 4096kB 80kB ESPino
espresso_lite_v1 esp8266 80Mhz 4096kB 80kB ESPresso Lite 1.0
espresso_lite_v2 esp8266 80Mhz 4096kB 80kB ESPresso Lite 2.0

Keybase proof

I hereby claim:

  • I am coaxial on github.
  • I am pypouj (https://keybase.io/pypouj) on keybase.
  • I have a public key ASAOEkq9Xtc5M5peHdROsFDOEayzUeR9MLBzXhRZQ6vyTwo

To claim this, I am signing this object:

@coaxial
coaxial / .bashrc
Created August 19, 2016 16:44
TravisCI status in OS X menubar
#!/usr/bin/env bash
# Requires AnyBar (https://github.com/tonsky/AnyBar) and hub (https://github.com/github/hub)#!/usr/bin/env bash
# Checks the ci-status on GitHub and changes the dot color accordingly
alias ciw='while true; do if [ "$(hub ci-status)" == "pending" ]; then echo -n "orange" | nc -4u -w0 localhost 1738; elif [ "$(hub ci-status)" == "success" ]; then echo -n "green" | nc -4u -w0 localhost 1738; break; else echo -n "red" | nc -4u -w0 localhost 1738; fi; sleep 5; done &'
@coaxial
coaxial / sysbackup.sh
Last active October 30, 2016 20:26
quick bash script to make system backups
#!/usr/bin/env bash
# tar -zcpf /mnt/storage/backups/`date "+%Y%m%d_%H%M%S"`_`hostname`.tar.gz --directory=/ --exclude=proc --exclude=sys --exclude=dev/pts --exclude=media --exclude=srv --exclude=mnt .
tar -jcpf /mnt/storage/backups/"$(date "+%Y%m%d_%H%M%S")"_"$(hostname)".tar.bz2 --one-file-system /
# Sample cron entry to run sysbackup every day at 4:52am, assuming this script is executable in /usr/bin/
# 52 4 * * * sysbackup
@coaxial
coaxial / private.xml
Created January 5, 2017 02:03
pause to sleep karabiner custom settings
<?xml version="1.0"?>
<root>
<item>
<name>Pause to sleep</name>
<appendix>Coaxial custom settings</appendix>
<identifier>coaxial-pause-to-sleep</identifier>
<autogen>
__KeyToKey__
KeyCode::PC_PAUSE,
KeyCode::VK_IOHIDPOSTEVENT_NX_POWER_KEY, ModifierFlag::OPTION_L | ModifierFlag::COMMAND_L
@coaxial
coaxial / bash_notes.md
Last active May 24, 2024 08:24
Notes on bash scripting
@coaxial
coaxial / hosts
Created April 11, 2017 17:24
spotify adblock host file
#/etc/hosts
0.0.0.0 pubads.g.doubleclick.net
0.0.0.0 securepubads.g.doubleclick.net
0.0.0.0 www.googletagservices.com
0.0.0.0 gads.pubmatic.com
0.0.0.0 ads.pubmatic.com
0.0.0.0 spclient.wg.spotify.com