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 'active_support/concern' | |
module ChildTrackable | |
extend ActiveSupport::Concern | |
# keep track of what classes have included this concern: | |
module Children | |
extend self | |
@included_in ||= [] |
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
# I had nginx and passenger already installed via brew: | |
# note: this caused problems with RVM & gemsets | |
brew uninstall nginx passenger | |
brew cleanup | |
########## | |
# from the IMS rails project: | |
# note/todo: add to Gemfile? | |
gem install passenger -v 5.0.10 |
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 run_cmd = function(cmd, args, callBack) { | |
var spawn = require('child_process').spawn; | |
var child = spawn(cmd, args); | |
var resp = ""; | |
child.stdout.on('data', function (buffer) { resp += buffer.toString() }); | |
child.stdout.on('end', function() { callBack (resp) }); | |
} | |
var check_ps_aux = function(service) { |
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 'capybara/rspec' | |
require 'capybara/poltergeist' | |
Capybara.register_driver :poltergeist do |app| | |
Capybara::Poltergeist::Driver.new(app, { | |
debug: true, | |
timeout: 120, | |
js_errors: true, | |
inspector: true, | |
phantomjs_options: ['--load-images=no', '--ignore-ssl-errors=yes'], |
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
# all emoji | |
# 1000.times { |i| emoji(127740 + i) + ' ' } | |
# moon phases | |
# 8.times { |i| emoji(127761 + i) } | |
DELAY = 0.3; | |
# clean screen | |
def clean |
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 error = undefined; | |
var result = "wee!"; | |
var chainableMethod = function () { | |
return new Promise(function(resolve, reject) { | |
if (error) { | |
console.log('got error'); | |
return reject(error); | |
} | |
console.log('no error'); |
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 'sidekiq/api' | |
namespace :sidekiq do | |
desc 'Output Sidekiq Status' | |
task status: :environment do | |
divider = '==================================================' | |
puts "#{divider}\nSTATS" | |
stats = Sidekiq::Stats.new | |
puts "\tProcesses:\t#{stats.processes_size}" |
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
"" | |
.getClass.getMethods.map(_.getName) // methods | |
.sorted // sort | |
.filter(_ matches "(?i).*index.*") // grep /index/i | |
///////// | |
implicit def toMethods(obj: AnyRef) = new { | |
def methods = obj.getClass.getMethods.map(_.getName) | |
} |
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 | |
require 'open-uri' | |
require 'json' | |
require 'pp' | |
ZEP_HOST = 'localhost' | |
ZEP_PORT = 8890 | |
ZEP_ADDR = "http://#{ZEP_HOST}:#{ZEP_PORT}" |
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
FROM busybox | |
ARG MESSAGE | |
RUN echo $MESSAGE > message.txt |