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(){ | |
if (typeof Object.create != 'function') { | |
Object.create = function(proto, propertiesObject) { | |
var pType = typeof propertiesObject; | |
if (pType == 'string' || pType == 'boolean' || pType == 'number') { | |
throw new TypeError('The second parameter to Object.create must be undefined or an object.'); | |
} | |
var Constructor = function() {}; | |
Constrcutor.prototype = proto; |
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 myMultiplierMaker = function(factor) { | |
var returnFunction = function(otherFactor) { | |
return factor * otherFactor; | |
} | |
return returnFunction; | |
} | |
var timesFive = myMultiplierMaker(5); | |
var timesSeven = myMultiplierMaker(7); |
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
;;; This was installed by package-install.el. | |
;;; This provides support for the package system and | |
;;; interfacing with ELPA, the package archive. | |
;;; Move this code earlier if you want to reference | |
;;; packages in your .emacs. | |
(when | |
(load | |
(expand-file-name "~/.emacs.d/elpa/package.el")) | |
(package-initialize)) |
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'nokogiri' | |
doc = Nokogiri::HTML.parse(open('input.html'), nil, 'utf-8') | |
meta_content_type = Nokogiri::XML::Node.new 'meta', doc | |
meta_content_type['http-equiv'] = 'Content-Type' | |
meta_content_type['content'] = 'text/html; charset=utf-8' |
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
# To enable files to be served from "./public/", the :static | |
# and :app_file options have to be set. | |
require 'rubygems' | |
require 'sinatra/base' | |
class App < Sinatra::Base | |
set :static, true | |
set :app_file, __FILE__ | |
NewerOlder