[ Launch: d3 box plot ] 83239bdc4d09ad7fc920 by Aeon
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 'sinatra' | |
| logfile = 'log.json' | |
| get '/' do | |
| send_file logfile, :type => :text | |
| end | |
| post '/' do | |
| File.open(logfile, 'a') do |filehandle| |
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
| /* | |
| * gulp and site config based on | |
| * http://justinjohnson.org/javascript/getting-started-with-gulp-and-browserify/ | |
| * https://gist.github.com/Sigmus/9253068 | |
| * | |
| */ | |
| try { | |
| var gulp = require('gulp'), |
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 page = new WebPage(), | |
| address, selector, filename; | |
| var system = require('system'); | |
| page.onConsoleMessage = function(msg) { | |
| system.stderr.writeLine('console: ' + msg); | |
| }; | |
| //capture and captureSelector functions adapted from CasperJS - https://github.com/n1k0/casperjs | |
| capture = function(targetFile, clips) { |
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 'resque' | |
| Resque.redis.namespace = "resque:#{ENV['APP_NAME']}" | |
| while Resque::Failure.count > 0 do |i| | |
| job = Resque::Failure.all(0,1) | |
| unless !job || job['retried_at'].nil? | |
| Resque::Failure.remove(0) | |
| else | |
| break |
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 'api/pools.rb' | |
| module Mtool | |
| extend Blather::DSL | |
| #Blather.logger.level = Logger::DEBUG | |
| Blather.logger.level = Logger::INFO | |
| @@faye = nil |
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('config/adapters/faye-adapter'); | |
| export default DS.FayeAdapter.extend(); |
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
| git log --author="`git config user.name`" --shortstat --since=yesterday | egrep 'files? changed' | awk '{files+=$1; inserted+=$4; deleted+=$6} END {print "", files, "files changed,", inserted, "insertions(+),", deleted, "deletions(-)"}' |
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
| if you have a list of files that you had to temporarily move | |
| out of a nested subdirectory set into a single directory, you | |
| can move them back correctly by doing this on the list of | |
| original locations | |
| search and replace | |
| ^(.*?)?([^/\n]*/?)$ | |
| with | |
| mv "$2" "/origin/$0" |
anyway what happens is
- parent opens db connection
$db - parent forks child worker, which inherits the connection resource
- child worker does some work and exits (successfully or not)
- php cleans up any open resource handles,
$dbamong them. - parent thinks
$dbis still a valid resource. - parent tries to access it, or parent forks a new child and gives it the invalid handle...
- php goes boom, because it tries to use an invalid connection resource.