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
/** | |
* Get a user's public GitHub activity using the GitHub API | |
* Returns a promise | |
*/ | |
function GitHubActivity(username) { | |
var master, fetch, collectedData; | |
collectedData = []; | |
/** |
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 | |
sample_size = 3000 | |
stay_counter = 0 | |
switch_counter = 0 | |
sample_size.times do |i| | |
# Randomly create a scenario | |
winning_door = [1,2,3].sample |
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
/** | |
* A Unique Collection Object | |
* Items are alphanumeric strings (defined by createItem function) | |
* Items are 7 characters long (defined by itemLength variable) | |
*/ | |
function UniqueCollection() { | |
var items = []; | |
var itemLength = 7; | |
/* Create a new item */ |
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
/* | |
* A virtual dice roller that accepts standard dice notation | |
* | |
* | |
* Dice Notation | |
* | |
* [Num Dice] d <Num Sides> [Modifier] | |
* | |
* | |
* Num Dice - Number of dice to roll (optional) |
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"; | |
/* ============================================================================ | |
Gibson Research Corporation | |
UHEPRNG - Ultra High Entropy Pseudo-Random Number Generator | |
============================================================================ | |
This is GRC's cryptographically strong PRNG (pseudo-random number generator) | |
for JavaScript. It is driven by 1536 bits of entropy, stored in an array of | |
48, 32-bit JavaScript variables. Since many applications of this generator, | |
including ours with the "Off The Grid" Latin Square generator, may require | |
the deteriministic re-generation of a sequence of PRNs, this PRNG's initial |
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
# Read and write spreadsheets with ruby using the spreadsheet gem | |
# Full Docs: http://spreadsheet.rubyforge.org/GUIDE_txt.html | |
require 'spreadsheet' | |
# Open source spreadsheet | |
workbook = Spreadsheet.open 'source.xls' | |
# READ |
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 | |
class UI | |
def self.prompt_for_player_names | |
puts " _____ _____ ______ ______ _____ " | |
puts " / ____| | __ \\ | ____| | ____| | __ \\ " | |
puts " | | __ | |__) | | |__ | |__ | | | | " | |
puts " | | |_ | | _ / | __| | __| | | | | " | |
puts " | |__| | | | \\ \\ | |____ | |____ | |__| | " | |
puts " \\_____| |_| \\_\\ |______| |______| |_____/ " |
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
def colorize(value, color) | |
case color | |
when :black then "\e[30m" + value.to_s + "\e[0m" | |
when :red then "\e[31m" + value.to_s + "\e[0m" | |
when :green then "\e[32m" + value.to_s + "\e[0m" | |
when :yellow then "\e[33m" + value.to_s + "\e[0m" | |
when :blue then "\e[34m" + value.to_s + "\e[0m" | |
when :magenta then "\e[35m" + value.to_s + "\e[0m" | |
when :cyan then "\e[36m" + value.to_s + "\e[0m" | |
when :white then "\e[37m" + value.to_s + "\e[0m" |
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
[Desktop Entry] | |
Type=Application | |
Terminal=false | |
StartupNotify=true | |
Name=Sublime Text 2 | |
Name[en_US]=Sublime Text 2 | |
GenericName=Text Editor | |
GenericName[en_US]=Text Editor | |
Comment=Edit text files | |
Comment[en_US]=Edit text files |
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> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Movable and Re-sizable Raphael JS Shape</title> | |
</head> | |
<body> | |
<div id="paper"></div> |