Skip to content

Instantly share code, notes, and snippets.

jasonroelofs / dupefinder.js
Last active Dec 27, 2017 — forked from mattslack/dupefinder.js
Find duplicate IDs in a document.
View dupefinder.js
(function () {
"use strict";
var find_dupes = function () {
var identified = document.querySelectorAll('[id]'),
found = {},
for (idx = 0; idx < identified.length; idx++) {
id = (identified[idx]).getAttribute('id');
if(found[id]) {
jasonroelofs /
Created Apr 27, 2011 — forked from collegeman/
Turn an Ubuntu 10.10 EC2 into a StatsD/Graphite server
# 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
cd node
sudo make install
# install the Node package manager for later use
View animal.rb
class Animal
def noise(sound, &block)
class Cow < Animal
def moo(&block)
noise("moo", &block)
View rice_custom_exceptions.cpp
/* 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;
View extconf.rb
require 'mkmf-rice'
View scene.cpp
// 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
View ruby-search.ubiquity-command.js
name: "rails",
takes: {"function": noun_arb_text},
icon: "",
homepage: "",
author: {name: "Jack Dempsey", email: ""},
license: "MPL,GPL",
description: "Search rails functions documentation",
help: "Select a rails function",
You can’t perform that action at this time.