Skip to content

Instantly share code, notes, and snippets.

View buzzedword's full-sized avatar
:octocat:
Live and in stereo

Danny Garcia-Huang buzzedword

:octocat:
Live and in stereo
View GitHub Profile
@buzzedword
buzzedword / Bash crap.sh
Created June 25, 2012 15:48
Initial setups
# Xcode
open http://itunes.apple.com/us/app/xcode/id497799835?mt=12
# Homebrew
/usr/bin/ruby -e "$(/usr/bin/curl -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"
# Git
brew install git
# Git Flow
@buzzedword
buzzedword / piracy.js
Created June 22, 2012 15:43
Downloading Calvin & Hobbs
// On http://imgur.com/a/EYCTw
// Open Console
var downloadString = '';
$('.image-hover.download a').each(function(i){
downloadString += 'echo "Downloading '+ (i+1) + '.jpg..."\n\r';
downloadString += 'curl -L http://www.imgur.com' + $(this).attr('href') +' -o '+ (i+1) + '.jpg\n\r';
downloadString += 'echo "Finished! Waiting 3 seconds before continuing..."\n\r';
downloadString += 'echo \n\r';
downloadString += 'sleep 3 \n\r';
@buzzedword
buzzedword / .twitter-bootstrap
Created May 23, 2012 19:18
One of these days, I'll turn this into an actual script.
# Requires UglifyJS and LESSCSS
alias reduce="cat js/bootstrap-transition.js js/bootstrap-alert.js js/bootstrap-modal.js js/bootstrap-dropdown.js js/bootstrap-scrollspy.js js/bootstrap-tab.js js/bootstrap-tooltip.js js/bootstrap-popover.js js/bootstrap-button.js js/bootstrap-collapse.js js/bootstrap-carousel.js js/bootstrap-typeahead.js | uglifyjs -o js/bootstrap-concat.min.js -nc"
alias twitter-bootstrap-full="clear && echo 'Cloning the Twitter Bootstrap...' && git clone git://github.com/twitter/bootstrap.git && echo 'Switching version to 2.0.3...' && cd bootstrap && git checkout v2.0.3 && echo 'Reducing javascript files to a single concatinated version...' && reduce && echo 'Creating initial bootstrap.css...' && mkdir css && lessc less/bootstrap.less css/bootstrap.css && echo 'Final cleanup...' && rm LICENSE Makefile README.md package.json .gitignore .travis.yml js/README.md && rm -rf .git docs js/tests less/tests && cd ../ && echo 'Twitter bootstrap setup completed.'"
@buzzedword
buzzedword / youtube_swfobject.js
Created May 18, 2012 21:17
Youtube player snippet
var player = function(selector, dimensions) {
var $yt = $(selector);
$yt.each(function() {
var $this = $(this);
var _data = $this.data();
var params = {
allowScriptAccess: "always",
wmode: 'opaque',
controls: 0,
@buzzedword
buzzedword / debugMode.js
Created May 18, 2012 18:51
Debug module for enabling and disabling console on the fly. Useful for server environment settings.
DebugModule: {
!
function(undefined) {
// Global debug object. Enable and disable console functionality. Defaults to off.
var Debug = function(bool) {
var func = {},
state = undefined,
Console = undefined,
// Common console functionality.
consoleFunctionality = {
@buzzedword
buzzedword / .zshrc
Created May 15, 2012 20:04
Oh-my-zsh configuration
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"
# Example aliases
@buzzedword
buzzedword / gist:2246110
Created March 30, 2012 03:04
Twitter Bootstrap: Grid Overlay
/*
* Grid Overlay for Twitter Bootstrap
* Assumes a 1.692em baseline grid (22px/13px)
*/
@media (min-width: 1200px) {
body {
background: -webkit-linear-gradient(
90deg,
rgba(0,0,0,0.05),
rgba(0,0,0,0.05) 4.545%,
<!DOCTYPE html>
<html>
<head>
...
<link href="style.min.less" rel="stylesheet" />
</head>
<body>
...
</body>
</html>
@buzzedword
buzzedword / plugins.js
Created October 26, 2011 18:24
Useful plugins found in my travels...
// Array Remove - By John Resig (MIT Licensed)
Array.prototype.remove = function(from, to) {
var rest = this.slice((to || from) + 1 || this.length);
this.length = from < 0 ? this.length + from : from;
return this.push.apply(this, rest);
};
// usage: log('inside coolFunc', this, arguments);
// paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/
window.log = function(){
@buzzedword
buzzedword / getScriptWrapper.jquery.js
Created October 26, 2011 18:23
Wraps getScript to inline all code, no matter where it came from.
jQuery.extend({
getScript: function(url, callback) {
var head = document.getElementsByTagName("head")[0],
script = document.createElement("script");
script.src = url;
// Handle Script loading
{
var f = false;