This file contains 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 () { | |
"use strict"; | |
var find_dupes = function () { | |
var identified = document.querySelectorAll('[id]'), | |
found = {}, | |
id, | |
idx; | |
for (idx = 0; idx < identified.length; idx++) { | |
id = (identified[idx]).getAttribute('id'); | |
if(found[id]) { |
This file contains 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
# install git | |
sudo apt-get install g++ curl libssl-dev apache2-utils | |
sudo apt-get install git-core | |
# download the Node source, compile and install it | |
git clone https://github.com/joyent/node.git | |
cd node | |
./configure | |
make | |
sudo make install | |
# install the Node package manager for later use |
This file contains 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 Animal | |
def noise(sound, &block) | |
block.call(sound) | |
end | |
end | |
class Cow < Animal | |
def moo(&block) | |
noise("moo", &block) | |
end |
This file contains 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
/* Basically, I want to throw a custom exception from C++. I'm kind of lost on how to do that :/ */ | |
// exceptions.hpp | |
class V8UnknownReturnValueException : public Rice::Exception { | |
}; | |
Rice::Object rb_eUnknownReturnValueException; |
This file contains 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 'mkmf-rice' | |
create_makefile('virtual') |
This file contains 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
// leaks memory because a copy of the value of scene is returned and the pointer is never deleted | |
Image Scene::draw() const { | |
Image scene = *(new Image()); | |
// build the scene | |
return *scene; | |
} | |
// doesn't leak memory, but is ugly |
This file contains 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
CmdUtils.CreateCommand( | |
{ | |
name: "rails", | |
takes: {"function": noun_arb_text}, | |
icon: "http://ruby-doc.org/favicon.ico", | |
homepage: "http://jackndempsey.blogspot.com", | |
author: {name: "Jack Dempsey", email: "[email protected]"}, | |
license: "MPL,GPL", | |
description: "Search rails functions documentation", | |
help: "Select a rails function", |