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
{ | |
init: function(elevators, floors) { | |
var LIFT_MAX_PERSON = 4; | |
var LIFT_CONSIDER_FULL = 0.6; | |
var GROUND_FLOOR_WEIGHT = 0.3; | |
var minimum_wait_challenges = [8, 9, 10, 11, 12, 13, 14, 15, 16]; | |
var move_or_less_challenges = [6, 7]; | |
var challenge = parseInt(document.URL.substr(document.URL.lastIndexOf("=")+1)); | |
var wait_mode = move_or_less_challenges.indexOf( challenge ) != -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
var today = new Date(); | |
var ago = today - 1000 * 60 * 60 * 24 * 1; | |
var yesterday = new Date(ago); | |
var dd = yesterday.getDate(); | |
var mm = yesterday.getMonth() + 1; | |
var yyyy = yesterday.getFullYear(); | |
if (dd < 10){ dd = '0' + dd } | |
if (mm < 10){ mm = '0' + mm } | |
date = yyyy+'-'+mm+'-'+dd; |
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
%w(Charger Escalade Cooper Viper Taurus Impala).each do |car| | |
Car.create(name: car) | |
end | |
%w(Aircon Rack Sunroof Rims 4WD).each do |feature| | |
Feature.create(name: feature) | |
end | |
aircon = Feature.where(name: 'Aircon').first | |
rack = Feature.where(name: 'Rack').first |
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
$(document).ready(function(){ | |
if (document.location.pathname.match(/\/notifications$/)) { | |
var array = [ | |
"adventure-cat", | |
"agendacat", | |
"andycat", | |
"baracktocat", | |
"bear-cavalry", | |
"benevocats", | |
"bouncercat", |
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 'typhoeus' | |
class DeployVerifier | |
def self.verify(asset_paths) | |
urls = asset_urls(asset_paths) | |
return 'No assets found' if urls.empty? | |
verify_urls(urls.uniq, &blk) | |
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
#! /usr/bin/env ruby | |
require 'rubygems' | |
require 'time' | |
require 'colorize' | |
require 'action_view' | |
require 'highline/import' | |
include ActionView::Helpers::DateHelper | |
include ActionView::Helpers::TextHelper | |
I18n.enforce_available_locales = false |
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 'faraday' | |
require 'base64' | |
require 'cgi' | |
host = 'https://bittrex.com/api/v1.1' | |
key = '5231569363514ee5a5a598efb483c25c' | |
secret = '54e4a7e2a34f4d3bb9a93f765e47cf69' | |
path = '/account/getorderhistory' | |
nonce = Time.now.to_i | |
url = "#{host}#{path}?apikey=#{key}&nonce=#{nonce}" |
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
# 9 hole challenge - http://codegolf.stackexchange.com/questions/16707/9-hole-challenge | |
# 1 Greenway | |
# f(c:string, n:integer) | |
# Prints a line containing n instances of c. | |
def a(n,c) | |
puts n*c | |
end | |
a('a',3) | |
# 2. Somewhere in the rough |
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
package main | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
) | |
const listenAddr = "localhost:4000" |
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 'open-uri' | |
require 'nokogiri' | |
require 'fileutils' | |
class Scraper | |
attr_accessor :url, :selector, :page | |
def initialize(url, selector) | |
@url = url |