Skip to content

Instantly share code, notes, and snippets.

View wyattdanger's full-sized avatar

Stephen Bush wyattdanger

View GitHub Profile
@wyattdanger
wyattdanger / dad.md
Created April 9, 2012 03:52
dad post

Dad and I got to talk about programming for two weeks before he died.

I was 22, a senior in college completing a BFA in graphic design. Dad was 62, an older dad than most. When he started programming at Tennessee Tech back in the 60s, he wrote FORTRAN on punch cards. He was a wealth of knowledge.

I had just been introduced to code that semester, and it was already consuming my thoughts. It felt magical and powerful, in many ways a more fulfilling creative practice than visual design (but that's for another post).

When I came home for the holidays, Dad shared The Ten Commandments of Egoless Programming with me. He printed them and we discussed each point. It was one of the few programming related things we were able to discuss before he unexpectedly passed; perhaps that's why it sticks with me.

@wyattdanger
wyattdanger / whichquery.css
Created March 31, 2012 15:12
Determine which media query breakpoint you're on
body::before {
content: "< 480px"; }
@media only screen and (min-width: 480px) {
body::before {
content: "480px < 600px"; } }
@media only screen and (min-width: 600px) {
body::before {
content: "600px < 768px"; } }
@media only screen and (min-width: 768px) {
@wyattdanger
wyattdanger / whichquery.sass
Created March 31, 2012 15:08
Determine which media query breakpoint you're on
body::before
content: '< 480px'
@media only screen and (min-width: 480px)
body::before
content: '480px < 600px'
@media only screen and (min-width: 600px)
body::before
content: '600px < 768px'
@wyattdanger
wyattdanger / yaml_reader.rb
Created March 20, 2012 02:12
class that accepts a yaml file and dynamically creates getters/setters for each yaml key
class YAMLReader
def initialize yaml_file_path
YAML.load_file(yaml_file_path).each do |key, value|
self.class.instance_eval do
attr_accessor :"#{key}"
end
self.send "#{key}=", value
end
end
end

Open Terminal.app and type ifconfig and then hit return. You should see something like this. I've highlighted the IP

ifconfig

Then visit that IP in your web browser. You should see the same thing that you see when you visit localhost

If your phone and computer are on the same wifi network, you should now be able to access your localhost from your phone.

// Keymaster.js https://github.com/madrobby/keymaster
(function(a){function h(a,b){var c=a.length;while(c--)if(a[c]===b)return c;return-1}function i(a){var b,g,i,j,k,m;g=(a.target||a.srcElement).tagName,b=a.keyCode;if(b==93||b==224)b=91;if(b in d){d[b]=!0;for(j in f)f[j]==b&&(l[j]=!0);return}if(g=="INPUT"||g=="SELECT"||g=="TEXTAREA")return;if(!(b in c))return;for(k=0;k<c[b].length;k++){i=c[b][k];if(i.scope==e||i.scope=="all"){m=i.mods.length>0;for(j in d)if(!d[j]&&h(i.mods,+j)>-1||d[j]&&h(i.mods,+j)==-1)m=!1;(i.mods.length==0&&!d[16]&&!d[18]&&!d[17]&&!d[91]||m)&&i.method(a,i)===!1&&(a.preventDefault?a.preventDefault():a.returnValue=!1,a.stopPropagation&&a.stopPropagation(),a.cancelBubble&&(a.cancelBubble=!0))}}}function j(a){var b=a.keyCode,c;if(b==93||b==224)b=91;if(b in d){d[b]=!1;for(c in f)f[c]==b&&(l[c]=!1)}}function k(){for(b in d)d[b]=!1;for(b in f)l[b]=!1}function l(a,b,d){var e,h,i,j;d===undefined&&(d=b,b="all"),a=a.replace(/\s/g,""),e=a.split(","),e[e.length-1]==""&&(e[e.length-2]+=",");for(i=0;i<e
Creating gist failed: 200 OK
/* <li><a data-icon="a" href="/">A/B Split Testing</a></li> */
li a::before {
content: attr(data-icon);
}
@font-face {
font-family: 'Features Icons';
src: url('features-icons.eot');
src: local('☺'),
url('features-icons.woff') format('woff'),
url('features-icons.ttf') format('truetype')
}
li a::before {
font-family: 'Features Icons';
#unbind C-b
set-option -g prefix C-w
bind-key C-w last-window
set -g base-index 1
set-option -g default-terminal "screen-256color"
# act like vim
setw -g mode-keys vi
bind h select-pane -L
bind j select-pane -D