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
| require 'nokogiri' | |
| require 'open-uri' | |
| require 'terminal-notifier' | |
| title = 'Bitcoin Gem' | |
| activate = 'com.googlecode.iterm2' | |
| current_price = 0 | |
| while 1 |
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
| cards = [*'2'..'10', 'J', 'Q', 'K', 'A'] | |
| suits = ['C', 'D', 'H', 'S'] | |
| deck = cards.product(suits).map(&:join) | |
| 13.times do | |
| r = rand(1..52) | |
| cut = deck.pop(r) | |
| deck.unshift(cut).flatten! | |
| end |
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 request = require('request'); | |
| var cheerio = require('cheerio'); | |
| var fs = require('fs'); | |
| var data = fs.createWriteStream('data.txt', {'flags': 'a'}); | |
| var urlsToCrawl = []; | |
| var spider = function(url) { | |
| var index = urlsToCrawl.indexOf(url); |
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
| Maybe = function(value) { | |
| var Nothing = {}; | |
| var Something = function(value) { | |
| return function() { | |
| return value; | |
| }; | |
| }; | |
| if (typeof value === 'undefined' || value === null) |
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
| // | |
| // ICEBrain.h | |
| // | |
| #import <Foundation/Foundation.h> | |
| @interface ICEBrain : NSObject | |
| @property (nonatomic) NSString *someProperty; |
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
| module EventMapper | |
| def on(event, &block) | |
| if @events.nil? | |
| @events = { event => [block] } | |
| elsif @events[event].nil? | |
| @events[event] = [block] | |
| else | |
| @events[event] << block | |
| end | |
| end |
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
| description "Ruby App" | |
| start on net-device-up IFACE=eth0 | |
| stop on shutdown | |
| respawn | |
| setuid user | |
| setgid user |
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
| window.onload = function() { | |
| var lastCalledTime; | |
| var counter = 0; | |
| var fpsArray = []; | |
| function update(timestamp) { | |
| var fps; | |
| if (!lastCalledTime) { | |
| lastCalledTime = new Date().getTime(); |
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 nearby_az(string) | |
| raise ArgumentError if !string.include? 'a' | |
| a_idx = string.index("a") | |
| string[a_idx + 1] == "z" || string[a_idx + 2] == "z" || string[a_idx +3] == "z" | |
| end |
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 allows you to use alt+` to switch between windows of the same application akin to OS X's CMD+` | |
| !`:: ; Next window | |
| WinGetClass, ActiveClass, A | |
| WinSet, Bottom,, A | |
| WinActivate, ahk_class %ActiveClass% | |
| return |