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 'octokit' | |
require 'git' | |
require 'optparse' | |
require 'io/console' | |
default_options = { | |
:owner => 'coupa', | |
:github_repo => 'coupa_development', |
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 'net/https' | |
require 'json' | |
LAST_MESSAGE_FILE = "#{File.dirname(__FILE__)}/last_github_status.json" | |
HIPCHAT_API_KEY = 'secret' | |
HIPCHAT_ROOM = 'Notifications' | |
class GithubStatus |
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
# this rakefile is designed to be run alone. rails needs to be explicitly loaded if needed | |
require 'digest/sha1' | |
require 'fileutils' | |
require 'yaml' | |
namespace :db do | |
namespace :cached do | |
desc 'load the cached dump or regenerate if necessary' | |
task :setup_all do |
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 'open-uri' | |
require 'nokogiri' | |
TRANSIT_TOKEN = 'b2b9c476-6788-4a14-857b-fa3e828f99d0' | |
STOP_CODE = '70091' | |
# San Mateo NB: 70091 | |
# San Mateo SB: 70092 | |
# Hayward Park NB: 70101 | |
# Hayward Park SB: 70102 |
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
javascript: (function () { var links = document.getElementsByTagName("a"); for(var i = 0; i < links.length; i++) { var link = links[i]; link.innerText = link.innerText.replace(/\([^)]*\)>?#/, "#") }; }()); |
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 Hash | |
def deep_assoc(*keys) | |
current = fetch(keys.shift, nil) | |
return current if keys.empty? | |
return nil unless current.is_a?(Hash) | |
current.deep_assoc(*keys) | |
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
;; -*- mode: emacs-lisp -*- | |
;; This file is loaded by Spacemacs at startup. | |
;; It must be stored in your home directory. | |
(defun dotspacemacs/layers () | |
"Configuration Layers declaration." | |
(setq-default | |
;; List of additional paths where to look for configuration layers. | |
;; Paths must have a trailing slash (ie. `~/.mycontribs/') | |
dotspacemacs-configuration-layer-path '() |
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 'time' | |
require 'logger' | |
require 'aws-sdk' | |
AWS_REGION = "us-east-1" | |
AWS_KEY_ID = "" | |
AWS_SECRET_KEY = "" |
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
inc_map = function (ary) { | |
return ary.reduce( | |
function(result, input) { | |
return result.concat(input + 1); | |
}, []); | |
}; | |
inc_map([1, 2, 3]); | |
map = function(transform, ary) { |
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 ActiveRecord::Associations::CollectionProxy::ActiveRecord_Associations_CollectionProxy_PaperTrail_Version | |
def changes_to | |
raise ArgumentError, "block required" unless block_given? | |
result = [] | |
changes = scope.to_a.map do |version| | |
version_state = yield version.reify | |
[version_state, version] | |
end.each_cons(2).select do |old, new| | |
old.first != new.first |
OlderNewer