This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // single global namespace | |
| var Resturaunt = (function (window, document, $, undefined) { | |
| // private variables | |
| var name = 'Building on Bond', | |
| location = (function () { | |
| // nested private variables | |
| var address = { street: '112 Bond St', | |
| city: 'Brooklyn', | |
| state: 'NY', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <style type="text/css"> | |
| html,body{ | |
| height:100%; | |
| margin:0; | |
| padding:0;} | |
| #offset{ | |
| width:100%; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sass --style compact --watch master.scss:style.css |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (true /* MONITOR_GLOBALS */) { | |
| (function(){ | |
| var globals = {}; | |
| var startGlobals = []; | |
| for (var j in window) { | |
| globals[j] = true; | |
| startGlobals.push(j); | |
| } | |
| if (true /* PRINT_INITIAL_GLOBALS */) | |
| console.log("Initial globals: "+startGlobals.sort().join(', ')); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| curl http://www.cl.cam.ac.uk/~rja14/Papers/SE-[01-10].pdf -o renamed_file_#1.pdf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function () { | |
| return Backbone.View.prototype.render(this, arguments); | |
| return Backbone.View.prototype.render(this, Array.prototype.slice.call(arguments)); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # load rails or RACK app if runnning pry in a project | |
| if Dir.exists? './config' | |
| current_app = './config/application.rb' if File.exists? './config/application.rb' | |
| current_app = './config/environment.rb' if File.exists? './config/environment.rb' | |
| require current_app if current_app | |
| end | |
| if defined? Rails && Rails.version[0..0] == "3" | |
| require 'rails/console/app' | |
| require 'rails/console/helpers' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # play jay-z | |
| jayz() { | |
| osascript <<-EOF | |
| tell application "iTunes" to play track 1 of playlist "Jay-Z" | |
| EOF | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ffmpeg -i moviet.flv -f mp3 sound.mp3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Detect unsuppoerted browsers exculding crawlers and chrome frame | |
| # browser gem - https://github.com/fnando/browser | |
| def is_unsupported_browser? | |
| is_ie = browser.ie6? || browser.ie7? || browser.ie8? | |
| is_firefox36 = browser.firefox? && browser.full_version.match(/^3.6.*/) | |
| is_crawler = request.env["HTTP_USER_AGENT"].match(/\(.*https?:\/\/.*\)/) if request.env["HTTP_USER_AGENT"] | |
| has_chrome_frame = request.env["HTTP_USER_AGENT"].match(/chromeframe/) if request.env["HTTP_USER_AGENT"] | |
| return !has_chrome_frame && (is_ie || is_firefox36) unless is_crawler |
OlderNewer