Skip to content

Instantly share code, notes, and snippets.

View baumicon's full-sized avatar

Michael Reyes baumicon

  • Lexipol
  • San Diego, CA
View GitHub Profile

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

@benjamincharity
benjamincharity / Local Fallback for jQuery and Modernizr
Created January 6, 2012 17:31
Include jQuery and Modernizr from a CDN and add local fallbacks in case the CDN fails. Versions written in HTML and HAML.
HTML
=====
<script type='text/javascript'>
window.jQuery || document.write('<script src="js/jquery-1.7.1.js">\x3C/script>')
</script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/modernizr/2.0.6/modernizr.min.js' type='text/javascript'></script>
<script type='text/javascript'>
window.Modernizr || document.write('<script src="js/modernizr-2.0.6.js">\x3C/script>')
</script>
@ryanwilliams
ryanwilliams / gist:1858984
Created February 18, 2012 11:54
Cocos2D v0.2 example in CoffeeScript
# Pull in the modules we're going to use
cocos = require 'cocos2d' # Import the cocos2d module
nodes = cocos.nodes # Convenient access to 'nodes'
events = require 'events' # Import the events module
geo = require 'geometry' # Import the geometry module
# Convenient access to some constructors
Layer = nodes.Layer
Scene = nodes.Scene
Label = nodes.Label
@henrik
henrik / ocr.markdown
Created March 3, 2012 17:07
OCR on OS X with tesseract

Install ImageMagick for image conversion:

brew install imagemagick

Install tesseract for OCR:

brew install tesseract --all-languages

Or install without --all-languages and install them manually as needed.

@chrisle
chrisle / gist:2252209
Created March 30, 2012 15:15
CURL as GoogleBot 2.1
curl --user-agent "Googlebot/2.1 (+http://www.google.com/bot.html)" -v $@
@chrisle
chrisle / gist:2319642
Created April 6, 2012 13:10
curl as ff
curl --user-agent "Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20120403211507 Firefox/12.0" http://www.google.com/search\?q\=law%20firm%20boston,%20ma
@MicahChalmer
MicahChalmer / .htaccess
Last active May 1, 2016 16:49
Scripts to set up Ruby 1.9.3 on a DreamHost shared hosting account via rbenv and ruby-build, and run a Rack app with it via FastCGI.
<IfModule mod_fastcgi.c>
AddHandler fastcgi-script .fcgi
</IfModule>
<IfModule mod_fcgid.c>
AddHandler fcgid-script .fcgi
</IfModule>
Options +FollowSymLinks +ExecCGI
RewriteEngine On
module CapybaraWithPhantomJs
include Capybara
# Create a new PhantomJS session in Capybara
def new_session
# Register PhantomJS (aka poltergeist) as the driver to use
Capybara.register_driver :poltergeist do |app|
Capybara::Poltergeist::Driver.new(app)
end
@shinriyo
shinriyo / hello.coffee
Last active December 14, 2015 17:39
cocos2d-x用サンプルコードをCoffeeScriptへ置き換えたhello.coffeeです。
try
cc.p = cc.p || (x, y)->
return {x:x, y:y}
cc.c4b = cc.c4 || (r, g, b, o)->
return {r: r, g: g, b: b, a: o}
cc.c3 = cc.c3 || (r, g, b)->
return {r: r, g: g, b: b}
cc.BLACK = cc.c3(0,0,0)
@konklone
konklone / Dockerfile
Created September 22, 2013 18:17
Dockerfile for installing Ruby 2.0 and RVM
FROM ubuntu
MAINTAINER Eric Mill "eric@konklone.com"
# turn on universe packages
RUN echo "deb http://archive.ubuntu.com/ubuntu raring main universe" > /etc/apt/sources.list
RUN apt-get update
# basics
RUN apt-get install -y nginx openssh-server git-core openssh-client curl
RUN apt-get install -y nano