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
// ==UserScript== | |
// @name Jenkins Threes | |
// @namespace http://use.i.E.your.homepage/ | |
// @version 0.1 | |
// @description Play Threes in your browser while you wait for stupid jenkins | |
// @match https://builds.dealer.ddc/* | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js | |
// @copyright 2014+, Dave Davis | |
// ==/UserScript== | |
$(function(){ |
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
var myApp = angular.module('myApp', []); | |
myApp.provider('helloWorld', function() { | |
// In the provider function, you cannot inject any | |
// service or factory. This can only be done at the | |
// "$get" method. | |
this.name = 'Default'; | |
this.$get = function() { |
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
<html> | |
<head> | |
<script type="text/javascript"> | |
// The purpose of this function is to draw a div inside another div | |
// at half dimensions (sort of like looking at a mirror in another | |
// mirror... | |
function turtles_all_the_way_down(previous_div, level, max_level){ | |
if(level == max_level){ | |
return; | |
} |
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
#!/bin/bash | |
set -x | |
# Make a new git bare repo | |
mkdir repo | |
cd repo | |
git init --bare |
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
require 'rubygems' | |
require 'rack' | |
class Object | |
def webapp | |
class << self | |
define_method :call do |env| | |
func, *attrs = env['PATH_INFO'].split('/').reject(&:empty?) | |
[200, {}, send(func, *attrs)] | |
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
#ifdef WIN32 | |
# include "windows.h" | |
#endif | |
#include <iostream> | |
#include <sstream> | |
#include <fstream> | |
#include <cstdlib> | |
#include <ctime> |
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
#include <iostream> | |
using namespace std; | |
class Whatever { | |
private: | |
float *color; | |
public: | |
Whatever(); | |
Whatever(float*); |
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
function blah(){ | |
print("Hi"); | |
} | |
if(run){ | |
blah(); | |
} |
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
*** Exception PhusionPassenger::UnknownError in PhusionPassenger::Rack::ApplicationSpawner (Failed to connect to a master node at 127.0.0.1:27017 (Mongo::ConnectionFailure)) (process 5177, thread #<Thread:0x00000000ad30e0>): | |
from /var/www/rails/simpletask/shared/bundle/ruby/1.9.1/gems/mongo-1.8.1/lib/mongo/mongo_client.rb:479:in `connect' | |
from /var/www/rails/simpletask/shared/bundle/ruby/1.9.1/gems/mongo-1.8.1/lib/mongo/mongo_client.rb:631:in `setup' | |
from /var/www/rails/simpletask/shared/bundle/ruby/1.9.1/gems/mongo-1.8.1/lib/mongo/mongo_client.rb:147:in `initialize' | |
from /var/www/rails/simpletask/shared/bundle/ruby/1.9.1/gems/mongo-1.8.1/lib/mongo/legacy.rb:56:in `initialize' | |
from /var/www/rails/simpletask/shared/bundle/ruby/1.9.1/gems/mongo_mapper-0.11.0/lib/mongo_mapper/connection.rb:72:in `new' | |
from /var/www/rails/simpletask/shared/bundle/ruby/1.9.1/gems/mongo_mapper-0.11.0/lib/mongo_mapper/connection.rb:72:in `connect' | |
from /var/www/rails/simpletask |
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
# I want to capture the output of both forked processes, print it, and then | |
# end. Currently the program hangs after printing the output from both forked | |
# processes. I think this is because "reader.eof?" doesn't return true because | |
# neither sub-process ever calls "writer.close". They don't call that because | |
# they can't, since exec changes the current process, so any ruby after the | |
# exec call won't get run. | |
# | |
# How do I handle this? Should I not use fork/exec? | |
# UPDATE: Answer below | |
reader, writer = IO.pipe |
OlderNewer