Skip to content

Instantly share code, notes, and snippets.

View ubermajestix's full-sized avatar

Tyler Montgomery ubermajestix

View GitHub Profile
@justlaputa
justlaputa / jenkins-api.md
Last active May 17, 2024 14:53
Jenkins Json API

jobs

jenkins_url + /api/json?tree=jobs[name,color]

builds

jenkins_url + /job/${job_name}/api/json?tree=builds[number,status,timestamp,id,result]

last build

@zerowidth
zerowidth / bash_profile.sh
Created January 3, 2013 16:21
custom test runners with bash / fuubar / test/unit. hacks heaped upon hacks for a particular dev environment.
# http://www.linuxjournal.com/content/use-date-command-measure-elapsed-time
function timer() {
if [[ $# -eq 0 ]]; then
echo $(date '+%s')
else
local stime=$1
etime=$(date '+%s')
if [[ -z "$stime" ]]; then stime=$etime; fi
@ahoward
ahoward / quiz-1.md
Created September 26, 2012 15:41
quiz-1.md
So you think you wanna be a web developer...

Fork this, update your copy with answers.

They don't need to be precise - pseudo-code is fine in most cases.

Some questions don't have correct answers.

@cflipse
cflipse / Post.rb
Last active October 1, 2019 15:56
External Validations using only ActiveModel
require 'active_model'
# Most of this is the basic boilerplate described in the docs for active_model/errors; ie, the bare minimum
# a class must have to use AM::Errors
class Post
extend ActiveModel::Naming
attr_reader :errors
attr_accessor :title, :author, :publication_date
@quackingduck
quackingduck / config.ru
Created May 6, 2012 23:23
Rack config for a static site
# A config.ru useful for serving static sites from the "Bamboo" heroku stack.
#
# Interface:
#
# Url Path | Action
# -------- | -------------------------------------------------------------
# / | contents of: index.html OR
# | contents of: 404.html OR
# | default 404 message
# |
@zerowidth
zerowidth / rage.coffee
Created March 24, 2012 22:06
jointhecolorwar rage face
# npm install socket.io-client canvas
io = require "socket.io-client"
util = require "util"
fs = require "fs"
Canvas = require "canvas"
EventEmitter = require("events").EventEmitter
class Pixels extends EventEmitter
constructor: ->
##########################################################################
# something like this which can dump your db in a portable format. you could use mongodump... etc.
#
def App.db_snapshot
reinitialize_loggers if defined?(reinitialize_loggers)
$db_collections = Map.new
require 'minitest/unit'
require 'celluloid'
module MiniTest
module Celluloid
class Runner < MiniTest::Unit
def _run_suites(suites, type)
futures = suites.map do |suite|
::Celluloid::Future.new { _run_suite suite, type }
@paulca
paulca / .ey-example
Created February 20, 2012 22:46
Quick Deploy for Rails 3.1 on Engine Yard Cloud
# Place this file in the root of your project directory
# eg. APPNAME=tito
APPNAME=
# eg. APP_SERVERS=([email protected] [email protected])
APP_SERVERS=()
# eg. CACHE_DIRS=(public/cache)
CACHE_DIRS=()
@ahoward
ahoward / rego.rb
Created January 5, 2012 22:29
runs an arbitrary commands when files change
#! /usr/bin/env ruby
## rego command to run -- files to watch
#
# rego command_to_run on @ -- {lib/*,test/*}
#
require 'time'
require 'pathname'
require 'rubygems'