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
#include <iostream> | |
#include <vector> | |
using namespace std; | |
class Animal | |
{ | |
public: | |
virtual void sound() | |
{ |
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
/* | |
USAGE: | |
copy and paste all of this into the javascript console. you can then call falseVote(ians_comment_id, times) to upvote | |
ian as partygoer times times. you can also provide your own comment_id by doing an inspect element on the voting div | |
on anyone's profile. | |
the ajax requests are synchronous to allow for the coockie bs. this makes the execution seem slow for large times. | |
i wonder how long it takes to run it for thousands of iterations... | |
*/ |
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
# USAGE: | |
# ruby unshred.rb photo_name_1.png [photo_name_2.png] ... | |
# | |
# it will create an unshredded photo with the original name with "unshredded" prepended | |
# | |
require 'RMagick' | |
include Magick | |
SHRED_WIDTH = 32 |
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
window.onload = function() | |
{ | |
var headers = document.querySelectorAll('#docs h2, #guide h1'); | |
var menu = document.getElementById('menu'); | |
var init = menu.offsetTop; | |
var docked; | |
window.onscroll = function () | |
{ | |
if (!docked && (menu.offsetTop - scrollTop() < 0)) | |
{ |
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
include Rake::DSL | |
def rebuild(relative) | |
puts "------ change detected in #{relative}" | |
if relative.pathmap("%x") == ".scss" | |
sh 'sass', '--no-cache', '-r', './sass/addons/bourbon/lib/bourbon.rb', relative, "../www/stylesheets/"+relative.pathmap("%n.css") | |
elsif relative.pathmap("%x") == ".haml" | |
sh 'haml', '-f', 'html5', relative, "../www/"+relative.pathmap("%n.html") | |
end | |
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
// sonystyle ^_^ | |
int rand() { | |
return 1; | |
} |
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
// First and foremost, go to the NCCC site and watch one of the Tufts videos. | |
// Next execute this code using your browser's javascript console. | |
// In Chrome, press command + option + j to open the developer console. Alternatively, navigate to View > Developer > JavaScript Console. Paste this whole test file into the console that just opened. | |
// In Firefox, use the Firebug extension to execute javascript. | |
// In other browsers, kill yourself. | |
// You must leave the window open for the code to keep voting for our dudes. | |
function destroy_this() { | |
vote.castVote(); |
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 ActionDispatch::Routing::Mapper | |
def draw(routes_name) | |
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb"))) | |
end | |
end | |
BCX::Application.routes.draw do | |
draw :api | |
draw :account | |
draw :session |
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
// Just a quick hack for the cat lover in all of us | |
// Hijacks OMFGDOGS.com, and injects some Nyan Loveliness in there instead | |
// This is a bookmarklet! Copy and paste the code into an existing bookmark's URL, and rename it! | |
javascript:document.body.style.background='url(http://f.cl.ly/items/0x1J350B3E3t1h1b1m2r/0002.gif)';soundManager.stop('omfgdogs');soundManager.createSound({id: 'omfgnyan',url: 'http://iwantaneff.in/nyan.mp3',volume: 50,autoPlay: true,loops:999});void(0); |
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
tell application "iTunes" | |
repeat with t in selection | |
set da_name to (name of t) | |
set x to (offset of "." in da_name) + 2 | |
set y to (length of da_name) | |
set numbah to (text 1 thru ((offset of "." in da_name) - 1) of da_name) | |
set da_new_name to (text x thru y of da_name) | |
set name of t to da_new_name | |
set track number of t to numbah | |
end repeat |
OlderNewer