Skip to content

Instantly share code, notes, and snippets.

View shpshft's full-sized avatar

Joshua Butner shpshft

View GitHub Profile

Keybase proof

I hereby claim:

  • I am shpshft on github.
  • I am shpshft (https://keybase.io/shpshft) on keybase.
  • I have a public key ASAT2aqtR9-4x_uLVrJyoYdMK_PmNDLsmQUJ3_MAE-5m_Ao

To claim this, I am signing this object:

@shpshft
shpshft / bynines.zsh-theme
Last active April 20, 2018 21:02
bynines Oh My Zsh Theme
# bynines, derived from themes `amuse`, `bullet-train`, `candy-kingdom`, and `theunraveler`
# If rvm
rvm_current() {
rvm current 2>/dev/null
}
# If rbenv
rbenv_version() {
rbenv version 2>/dev/null | awk '{print $1}'
@shpshft
shpshft / 0_reuse_code.js
Created January 22, 2014 14:42
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
<!DOCTYPE html>
<html>
<head>
<title>PageView Grid</title>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script>
<script>
var Keen=Keen||{configure:function(e){this._cf=e},addEvent:function(e,t,n,i){this._eq=this._eq||[],this._eq.push([e,t,n,i])},setGlobalProperties:function(e){this._gp=e},onChartsReady:function(e){this._ocrq=this._ocrq||[],this._ocrq.push(e)}};(function(){var e=document.createElement("script");e.type="text/javascript",e.async=!0,e.src=("https:"==document.location.protocol?"https://":"http://")+"dc8na2hxrj29i.cloudfront.net/code/keen-2.1.0-min.js";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)})();
Keen.configure({
projectId: "<your-projectId>",
@shpshft
shpshft / project rvmrc to powrc
Created September 17, 2012 11:47
Switch .powrc to current rvm ruby & gemset for project
#---------------------------------------
# I used this to create a RVM-hook for
# switching the .powenv after each rvm
# use change.
#
# ~/.rvm/hooks/after_use_update_powrc
#---------------------------------------
for file in `ls ~/.pow/` ; do
POW_LINK_TARGET=`readlink ~/.pow/$file`
@shpshft
shpshft / dabblet.css
Created May 26, 2012 23:53 — forked from LeaVerou/dabblet.css
Vertical centering with Flexbox + margin fallback
/**
* Vertical centering with Flexbox + margin fallback
* Lea Verou & David Storey
*/
html, body { height: 100%; }
body {
width: 100%; /* needed for FF */
margin: 0;
@shpshft
shpshft / [snippet] Text Gradient, Webkit-only.css
Created April 12, 2012 17:51
Webkit-only text-gradient styles.
h1 {
background: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#333));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables

#Newbie programmer
def factorial(x):
if x == 0:
return 1
else:
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal
@shpshft
shpshft / normalized.html
Created January 17, 2012 15:25 — forked from scottkellum/normalized.html
pixel normalization
<!doctype html>
<html>
<head>
<!-- Encoding -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"></meta>