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
var myClosure = function() { | |
var secret = 42, getSecret, inc; | |
getSecret = function() { return secret; }; | |
inc = function() { secret += 1; }; | |
return { | |
getSecret: getSecret, | |
inc: inc |
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
class Foo | |
def foo | |
r = helper method(:bar) | |
# r = helper Proc.new { bar } | |
puts r | |
end | |
def bar | |
3 | |
end |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
## Prepare ################################################################### | |
# Remove RVM | |
rvm implode | |
# Ensure your homebrew is working properly and up to date | |
brew doctor | |
brew update | |
## Install ################################################################### |
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
var foo, changeProperty, changeParam; | |
foo = { | |
bar: 123 | |
}; | |
changeProperty = function (obj) { | |
obj.bar = 999; | |
}; |
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
'use strict'; | |
/* Services */ | |
// Demonstrate how to register services | |
// In this case it is a simple value service. | |
var servicesModule = angular.module('myApp.services', []).value('version', '0.1'); | |
servicesModule.factory('Foo', function () { |
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> | |
<title>Site Maintenance</title> | |
<style> | |
body { text-align: center; padding: 150px; } | |
h1 { font-size: 50px; } | |
body { font: 20px Helvetica, sans-serif; color: #333; } | |
article { display: block; text-align: left; width: 650px; margin: 0 auto; } | |
a { color: #dc8100; text-decoration: none; } | |
a:hover { color: #333; text-decoration: none; } | |
</style> |
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
require 'httpclient' | |
require 'nokogiri' | |
require 'fileutils' | |
def sanitize_file_name(file_name) | |
file_name.gsub(/[\*<>\[\]=\+"\\\/:;?]/, '_') | |
end | |
LOGIN_URL = 'https://rubytapas.dpdcart.com/subscriber/content' | |
URL_PREFIX = 'https://rubytapas.dpdcart.com' |
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
var CommandInterpreter, | |
AppendCommand; | |
CommandInterpreter = function () { | |
}; | |
CommandInterpreter.prototype.reset = function () { | |
}; | |
CommandInterpreter.prototype.parse = function (input) { |
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
set nocompatible | |
set hidden " allow unsaved background buffers and remember marks/undo for them | |
set number " turn on line numbering | |
set wildmode=longest,list " bash-style tab completion | |
set autoindent " turn on autoindent | |
set cursorline " highlight current line | |
set showmatch " jumps to opening bracket briefly | |
set hlsearch " turn on highlight for search |