Skip to content

Instantly share code, notes, and snippets.

View two7sclash-zz's full-sized avatar
🕶️

James Fishwick two7sclash-zz

🕶️
View GitHub Profile
#!/bin/zsh
# Check if xcode command line tools are installed
if ! [ "$(xcode-select -p)" ]; then
xcode-select --install
exit 1
fi
echo "Getting the Pivotal workstation setup scripts."
@two7sclash-zz
two7sclash-zz / _expertise-list.scss
Created May 24, 2017 14:09
_expertise-list.scss
.expertise-list-headline {
display: block;
text-align: center;
@include rem-fallback("padding-top", 1.25rem);
}
.expertise-list-content-container {
display: flex;
flex-wrap: wrap;
align-items: stretch;
@two7sclash-zz
two7sclash-zz / gist:84640af26d033ac93fd57a85a78f0ffb
Created April 19, 2017 18:06
recursive bulk flowgen application for bash/zsh
shopt -s globstar
for f in **/*.d.js; do flowgen "$f" -o "${f%%.d.js}".flow.js; done
@two7sclash-zz
two7sclash-zz / gist:90f6c06640c855b3333606a685008ae0
Last active February 23, 2017 18:59
dealing with runaway jobs os x
Show which processes are listening to which ports -- lsof -i | grep LISTEN
Show which process is running on a specific port -- lsof -i TCP:3000
@two7sclash-zz
two7sclash-zz / 0_reuse_code.js
Created January 11, 2017 15:22
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
We couldn’t find that file to show.
@two7sclash-zz
two7sclash-zz / styles.less
Created January 4, 2017 16:25 — forked from ryanpcmcquen/styles.less
Ligature fonts for atom
atom-text-editor {
font-family: 'Fira Code';
font-style: normal;
text-rendering: optimizeLegibility;
}
atom-text-editor::shadow {
.string.quoted,
.string.regexp {
-webkit-font-feature-settings: "liga" off, "calt" off;
@two7sclash-zz
two7sclash-zz / gist:c3835d83695b46ca2a6a4b6d71272538
Created November 29, 2016 19:39
Groovy Convert To Camel Case or Snake Case
static String toCamelCase( String text, boolean capitalized = false ) {
text = text.replaceAll( "(_)([A-Za-z0-9])", { Object[] it -> it[2].toUpperCase() } )
return capitalized ? capitalize(text) : text
}
static String toSnakeCase( String text ) {
text.replaceAll( /([A-Z])/, /_$1/ ).toLowerCase().replaceAll( /^_/, '' )
}
@two7sclash-zz
two7sclash-zz / replacer.py
Created October 19, 2016 01:07 — forked from yv84/replacer.py
Script to recursively replace string in filename and contents
"""
Usage: python script.py search_string replace_string dir
Eg. python batchreplace.py galleries productions /Sites/cjc/application/modules/productions/
And it will search recursively in dir
and replace search_string in contents
and in filenames.
Case-sensitive
"""
from sys import argv
@two7sclash-zz
two7sclash-zz / latency_humanized.markdown
Created October 13, 2016 14:28
Latency numbers every programmer should know

Lets multiply all these durations by a billion:

Magnitudes:

Minute:

L1 cache reference                  0.5 s         One heart beat (0.5 s)
Branch mispredict                   5 s           Yawn
L2 cache reference                  7 s           Long yawn
Mutex lock/unlock                   25 s          Making a coffee