Skip to content

Instantly share code, notes, and snippets.

@mkandalf
mkandalf / .vimrc
Created October 19, 2012 00:56
Nick's .vimrc
" ========
" Filetype
" ========
filetype off
filetype plugin indent on
" ========
" General Setup
" =======
set nocompatible
@myobie
myobie / mountain-lion-brew-setup.markdown
Created February 18, 2012 20:14
Get Mountain Lion and Homebrew to Be Happy

Get Mountain Lion and Homebrew to Be Happy

1) Install XCode 4.4 into /Applications

Get it from the App Store.

2) Install Command Line Tools

In XCode's Preferences > Downloads you can install command line tools.

@pixelmatrix
pixelmatrix / caveatPatchor.js
Created February 25, 2011 05:17 — forked from protocool/caveatPatchor.js
Add Droplr support to caveatPatchor
/*
As of version 1.1.2, Propane will load and execute the contents of
~Library/Application Support/Propane/unsupported/caveatPatchor.js
immediately following the execution of its own enhancer.js file.
You can use this mechanism to add your own customizations to Campfire
in Propane.
Below you'll find two customization examples.
@julienXX
julienXX / clouds_midnight.vim
Created January 24, 2011 16:09
Clouds midnight theme for Vim by @stevelosh
" Vim color file
" Converted from Textmate theme Clouds Midnight using Coloration v0.2.4 (http://github.com/sickill/coloration)
set background=dark
highlight clear
if exists("syntax_on")
syntax reset
endif
@caged
caged / stale.rb
Created January 4, 2011 20:11
Quick script to help you find and deal with old watched repos, forks and owned repos.
#!/usr/bin/env ruby
#
# Quick hack to help you find and deal with old watched repos, forks and owned repos.
#
# It will ask you to confirm once if you want to unwatch a repo.
#
# You can't unwatch your own repos, so they will need to be deleted.
# THIS SCRIPT WILL ASK YOU FOR CONFIRMATION TWICE BEFORE IT DELETES A REPO.
#
require 'rubygems'
@sjl
sjl / google-jslint.vim
Created December 2, 2010 17:13
Use Google's JSLint with Vim. Now you can use :make when in a .js file to run gjslint on it and get a list of errors in the quickfix window. This was thrown together hastily and Vim's errorformat is confusing as hell, so feel free to fork and improve
au BufNewFile,BufRead *.js set makeprg=gjslint\ %
" The ^G at the end is an actual <Ctrl-G> char.
" Gist won't let me include it, so you'll have to delete the last two characters
" and insert it yourself with <Ctrl-V><Ctrl-G>
au BufNewFile,BufRead *.js set errorformat=%-P-----\ FILE\ \ :\ \ %f\ -----,Line\ %l\\,\ E:%n:\ %m,%-Q,%-GFound\ %s,%-GSome\ %s,%-Gfixjsstyle%s,%-Gscript\ can\ %s,%-G^G
@jcontonio
jcontonio / spec.watchr.rb
Created November 16, 2010 15:55
Watchr script for running Jasmine BDD as autotest
# Run me with: $ watchr watchr.rb
def run(cmd)
puts(cmd)
system(cmd)
end
def run_all_tests
cmd = "ruby run_specs.rb -f n -c"
run(cmd)
end

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

@HenrikJoreteg
HenrikJoreteg / JS Util solution using underscore.js
Created October 22, 2010 21:20
Rather than creating some other util global, just extend underscore.js with any additional methods you want.
// If you don't use underscore.js, use it (http://documentcloud.github.com/underscore/)
// Then, use underscore's mixin method to extend it with all your other utility methods
// like so:
_.mixin({
escapeHtml: function () {
return this.replace(/&/g,'&amp;')
.replace(/>/g,'&gt;')
.replace(/</g,'&lt;')
.replace(/"/g,'&quot;')
.replace(/'/g,'&#39;');
require 'sass'
module Sass::Script::Functions
def strip_unit(value)
Sass::Script::Number.new(value.value)
end
end