Skip to content

Instantly share code, notes, and snippets.

View skarfacegc's full-sized avatar
💭
slowly working on Gue

Andrew Williams skarfacegc

💭
slowly working on Gue
View GitHub Profile
@skarfacegc
skarfacegc / Array promise chain.js
Created July 15, 2017 17:00
Array promise chain created by skarfacegc - https://repl.it/JR1a/117
let foo = [];
foo[0] = () => {
return new Promise((resolve,reject) => {
setTimeout(() =>{
console.log('a');
resolve(1);
}, 100);
});
@skarfacegc
skarfacegc / execa.js
Created April 2, 2017 19:31
execa Stream and Promise example
'use strict';
const execa = require('execa');
const getStream = require('get-stream');
let foo = execa.shell('sleep 3 && echo foo');
foo.then((result)=>{
console.log('Done');
console.log(result);
@skarfacegc
skarfacegc / promise.js
Created April 19, 2016 19:10
promise example from erik
function promised(fn) {
return function(cb) {
return new Promise(function(resolve, reject) {
fn(function { cb(); resolve() });
});
}
}
promised(myAsync)(myCallback).then(...);
@skarfacegc
skarfacegc / LoadModule.pm
Created June 5, 2015 14:48
Try to load specific version of a module
#
# Looks for moudules in ./lib with the name of Module-<version>.pl
# Loads the requested version when the module is 'use'ed
#
# Usage:
#
# use LoadModule MyModule => 'v1'
package LoadModule;
@skarfacegc
skarfacegc / tmuxinator config
Last active August 29, 2015 14:22
tmuxinator config
#~/.tmuxinator/FlowTrack.yml
name: FlowTrack2
root: ~/Development/FlowTrack2
# Optional tmux socket
# socket_name: foo
# Runs before everything. Use it to start daemons etc.
# pre: sudo /etc/rc.d/mysqld start
@skarfacegc
skarfacegc / keybase.md
Created April 16, 2014 19:59
My keybase.io verification file

Keybase proof

I hereby claim:

  • I am skarfacegc on github.
  • I am skarfacegc (https://keybase.io/skarfacegc) on keybase.
  • I have a public key whose fingerprint is 6A9A 1194 E747 D4A9 F7D9 158C 6876 333E 7FB8 DEA0

To claim this, I am signing this object:

@skarfacegc
skarfacegc / tmux.conf
Last active December 17, 2015 03:29
my tmux.conf
# my tmux config file
# Emacs bindings
set -gw mode-keys emacs
# windows numbers start at 1
set -g base-index 1
# aliases
@skarfacegc
skarfacegc / shell commands.sh
Last active December 15, 2015 06:09
Random useful shell commands
# list current network connections and refrsh every 2 seconds
watch "lsof -i -P |grep ESTABLISHED |awk '{printf \"%15.15s \\t%s\\n\", \$1, \$9}'"
# Show the number of commits per file
find . -type f -exec sh -c "echo {} ;git log --pretty=oneline {} |wc -l" \;
@skarfacegc
skarfacegc / slate.conf
Last active December 10, 2015 01:58
Slate stuff
config defaultToCurrentScreen true
# Shows app icons and background apps, spreads icons in the same place.
config windowHintsShowIcons true
config windowHintsIconAlpha 0.5
config windowHintsIgnoreHiddenWindows false
config windowHintsSpread true
config secondsBetweenRepeat 0.1
# Development layout
@skarfacegc
skarfacegc / gist:4161824
Created November 28, 2012 15:03
Copy perl modules
$ perlbrew switch 5.14.2
$ perl -MExtUtils::Installed -E 'say for ExtUtils::Installed->new->modules' > /tmp/installed.list
$ perlbrew switch perl-5.16.0
$ perlbrew install-cpanm
$ cat /tmp/installed.list | cpanm --interactive