Skip to content

Instantly share code, notes, and snippets.

View brianyang's full-sized avatar

Brian Yang brianyang

View GitHub Profile
"~/.vimrc" 18L, 218C
syntax on
colorscheme murphy
set guifont=Lucida\Console:h12
nmap <D-[> <<
nmap <D-]> >>
vmap <D-[> <gv
@brianyang
brianyang / unexpectedLoop.coffee
Created January 12, 2012 13:34
loop doesnt return as expected
unexpectedLoop: ->
$('body').children().each setTimeout(console.log('foo'), 1000)
@brianyang
brianyang / boiler.html
Created January 12, 2012 22:17
html5 boilerplate
< !doctype html >
<!--
paulirish.com / 2008 / conditional - stylesheets - vs - css - hacks - answer - neither / -->
<!--
[
if lt IE 7] > < html class = "no-js lt-ie9 lt-ie8 lt-ie7"
lang = "en" > < ![endif] -->
<!--
[
if IE 7] > < html class = "no-js lt-ie9 lt-ie8"
@brianyang
brianyang / .bash
Last active March 26, 2018 11:44
vimrc 2
function serve(){
local port="${1:-8000}"
open "http://localhost:${port}/"
python -m SimpleHTTPServer "$port"
}
@brianyang
brianyang / console-dummy.js
Created January 20, 2012 19:36
console dummy
if(typeof console === "undefined") {
console = { log: function() { } };
}
@brianyang
brianyang / Custom.css
Created January 28, 2012 15:35 — forked from bentruyman/Custom.css
IR_Black Theme for Chrome Developer Tools
/**********************************************/
/*
/* IR_Black Skin by Ben Truyman - 2011
/*
/* Based on Todd Werth's IR_Black:
/* http://blog.toddwerth.com/entries/2
/*
/* Inspired by Darcy Clarke's blog post:
/* http://darcyclarke.me/design/skin-your-chrome-inspector/
/*
@brianyang
brianyang / SpecialsBoardCustom.css
Created January 28, 2012 15:36
Darker Skin for Chrome Developer Tools
/**********************************************/
/*
/* Darker Skin by Darcy Clarke - 2011
/*
/* For how to install, or more themes, check out:
/* http://darcyclarke.me/design/skin-your-chrome-inspector/
/*
/* Color scheme is based on Joe Bergantine's Specials Board:
/* http://joebergantine.com/werkstatt/seestyle
/*
@brianyang
brianyang / 1 custom-plugin.js
Created January 31, 2012 03:35
plugin architecture guide
(function($) {
$.fn.likeButton = function() {
var obj = this;
var liked;
var status = obj.attr('class');
if (status && status.indexOf('active') != -1) {
liked = true;
} else {
liked = false;
}
@brianyang
brianyang / regex-var.js
Created February 3, 2012 14:51
regular expression with variable
var regExpVar = function() {
var catVar = "Category:.*"
var catPat = new RegExp(catVar, "g")
var genCatArr = dataBlock.match(catPat)
return this
}
@brianyang
brianyang / fb-api-demo.html
Created February 4, 2012 14:20
fb get faces
<html>
<head>
<style>
img { height: 30px; width: 30px; padding: 1px;}
</style>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.4.min.js"></script>
</head>
<body>
<div id="fb-root"></div>