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 CustomTimeParser | |
extend self | |
def get_time_interval(str_format = '%h:%m:%s', i_seconds=0, options = {}) | |
a_period = {'hour' => 0, 'min' => 0, 'sec' => 0 } | |
#-- Get the correct period |
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 BinaryTree | |
class Node | |
attr_reader :word, :count | |
attr_accessor :left, :right | |
include Enumerable | |
def initialize(word) | |
@word = word | |
@count = 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
require 'rubygems' | |
require 'mechanize' | |
require 'net/http' | |
require 'json' | |
#get the tmbundle forkers | |
url = "http://github.com/api/v2/json/repos/show/cucumber/cucumber-tmbundle/network" | |
cuke_tmbundle_forkers = JSON.parse(Net::HTTP.get_response(URI.parse(url)).body).first[1].map{ |x| x["owner"] } | |
agent = Mechanize.new |
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 'celluloid' | |
WORKERS_COUNT = (ARGV[0] || 1).to_i | |
class Output | |
include Celluloid | |
def puts(msg) | |
Kernel.puts(msg) | |
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
ANSI_COLOR_CODE = { | |
0 => 'black', | |
1 => 'red', | |
2 => 'green', | |
3 => 'yellow', | |
4 => 'blue', | |
5 => 'purple', | |
6 => 'cyan', | |
7 => 'white' | |
} |
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
source "https://rubygems.org" | |
gem 'eventmachine' | |
gem 'rubysl-stringio' | |
gem 'sinatra' | |
gem 'yajl-ruby', require: 'yajl' | |
gem 'thin' | |
gem 'em-websocket', :git=>'https://github.com/igrigorik/em-websocket.git' |
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
<?php | |
/* | |
Plugin Name: OLark | |
Description: Live Chat | |
Version: 1.0 | |
Author: Michael Bianco | |
Author URI: http://github.com/iloveitaly/ | |
*/ | |
function admin_page () { |
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
//basic zopim widget code, from their site | |
window.$zopim||(function(d,s){var z=$zopim=function(c){z._.push(c)},$=z.s= | |
d.createElement(s),e=d.getElementsByTagName(s)[0];z.set=function(o){z.set. | |
_.push(o)};z._=[];z.set._=[];$.async=!0;$.setAttribute('charset','utf-8'); | |
$.src='//v2.zopim.com/?26Smu9lv0NXQEOOg8IAZrMPh9yQstAcV';z.t=+new Date;$. | |
type='text/javascript';e.parentNode.insertBefore($,e)})(document,'script'); | |
//make sure zopim does not show till we know we have department agents | |
var intial_zopim_hiding_done = false; |
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
<!--Start of Zopim Live Chat Script--> | |
< script type = "text/javascript" > | |
window.$zopim || (function (d, s) { | |
var z = $zopim = function (c) { | |
z._.push(c) | |
}, $ = z.s = | |
d.createElement(s), | |
e = d.getElementsByTagName(s)[0]; | |
z.set = function (o) { | |
z.set. |
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
// | |
// Track.js - tracking scripts by alex miller | |
// | |
// | |
config = {}; | |
config.track = true;// set to true in production, false in dev env | |
config.dump = true;// set to false in production env, true in dev | |
config.mixpanel = true; // <%= TRACKS_CONFIG['mixpanel'] %>; // set to true in production env, false in dev | |
config.googleAnaltyics = true; |