Skip to content

Instantly share code, notes, and snippets.

[
{
"step": 1,
"repeat_index": 0,
"time_offset": 0,
"movements": [[x1, y1], [x2,y2], ..., [null, null], [x99, y99], ...],
"actions": [
{"time_offset": 4032, "input_type": "keyboard", "value": "spacebar"},
{"time_offset": 8944, "input_type": "mouse", "value": [123, 321]}
],
@findchris
findchris / gist:9985704
Created April 5, 2014 00:26
Run a single schema migration
class OneOff < ActiveRecord::Migration
def connection
ActiveRecord::Base.establish_connection("whatever_#{Rails.env}").connection
end
def up
puts 'up'
end
[
{
"step": 1,
"time_offset": 0,
"movements": [[123, 31], [321,22], [null, null], [99, 99]],
"actions": [
{"time_offset": 4032, "input_type": "keyboard", "value": "spacebar"},
{"time_offset": 8944, "input_type": "mouse", "value": [123,321]}
],
"distance": 3245
@findchris
findchris / gist:f2c95f18edc198375487
Created October 3, 2014 18:54
RTB process pre/post bridges
Pre-Bridges:
root 23061 26.9 5.6 558512 429120 ? Sl 03:29 223:20 exchange.rb -e prod -p 9000
root 23159 27.1 6.2 617852 476272 ? Sl 03:30 225:20 exchange.rb -e prod -p 9001
root 23233 25.8 6.3 615652 487016 ? Sl 03:30 214:04 exchange.rb -e prod -p 9002
root 23315 27.5 5.5 554480 425512 ? Rl 03:30 228:07 exchange.rb -e prod -p 9003
Post-Bridges:
root 19967 12.4 4.1 447460 319724 ? Rl Oct02 144:25 exchange.rb -e prod -p 9000
root 20017 12.0 4.5 473164 344452 ? Sl Oct02 139:48 exchange.rb -e prod -p 9001
root 20067 12.0 4.0 433524 308436 ? Sl Oct02 140:33 exchange.rb -e prod -p 9002
@findchris
findchris / all_crons.sh
Created November 25, 2014 19:41
List all cron jobs on a system
#!/bin/bash
# Credit to: http://serverfault.com/questions/135906/when-does-cron-daily-run
# System-wide crontab file and cron job directory. Change these for your system.
CRONTAB='/etc/crontab'
CRONDIR='/etc/cron.d'
# Single tab character. Annoyingly necessary.
tab=$(echo -en "\t")
@findchris
findchris / gist:56ce76d633223a7a634b
Created January 20, 2015 22:04
Page that generates 3 blank image sources
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>true[X]</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<script type="text/javascript">window.NREUM||(NREUM={});NREUM.info={"beacon":"beacon-6.newrelic.com","errorBeacon":"bam.nr-data.net","licenseKey":"6781978f3f","applicationID":"1341938","transactionName":"dVdXRkVcCQhUQ0pWDFFZXldaVgsQQh4LVhU=","queueTime":0,"applicationTime":527,"agentToken":null,"agent":"js-agent.newrelic.com/nr-476.min.js","ttGuid":"58f2de1f05378d97"}</script>
<script type="text/javascript">window.NREUM||(NREUM={}),__nr_require=function(t,e,n){function r(n){if(!e[n]){var o=e[n]={exports:{}};t[n][0].call(o.exports,function(e){var o=t[n][1][e];return r(o?o:e)},o,o.exports)}return e[n].exports}if("function"==typeof __nr_require)return __nr_require;for(var o=0;o<n.length;o++)r(n[o]);return r}({QJf3ax:[fu
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
function proml {
local BLUE="\[\033[0;34m\]"
local RED="\[\033[0;31m\]"
local LIGHT_RED="\[\033[1;31m\]"
local GREEN="\[\033[0;32m\]"
local LIGHT_GREEN="\[\033[1;32m\]"
[cornice_app(master)]$ git branch test_branch
[cornice_app(master)]$ git checkout test_branch
Switched to branch "test_branch"
[cornice_app(test_branch)]$ mate README
[cornice_app(test_branch)]$ git commit -a -m "Improved file significantly."
[test_branch 6bba901] Improved file significantly.
1 files changed, 1 insertions(+), 0 deletions(-)
[cornice_app(test_branch)]$ git checkout master
Switched to branch "master"
[cornice_app(master)]$ git merge test_branch
[chris@chris:~/code/tokyotest]$ ttserver -ext sets.lua
2010-02-24T14:45:14-08:00 SYSTEM --------- logging started [68331] --------
2010-02-24T14:45:14-08:00 SYSTEM server configuration: host=(any) port=1978
2010-02-24T14:45:14-08:00 SYSTEM maximum connection: 8191
2010-02-24T14:45:14-08:00 SYSTEM opening the database: *
2010-02-24T14:45:14-08:00 SYSTEM scripting extension: sets.lua
2010-02-24T14:45:14-08:00 SYSTEM service started: 68331
2010-02-24T14:45:14-08:00 INFO timer thread 1 started
2010-02-24T14:45:14-08:00 INFO worker thread 1 started
2010-02-24T14:45:14-08:00 INFO worker thread 2 started
1. apt-get install git
2. apt-get install libbz2-dev
3. cd /tmp
4. gem install rake-compiler
5. gem install ffi
1. OR
2. git clone git://github.com/ffi/ffi.git
3. cd ffi
4. rake gem:install