jenkins_url + /api/json?tree=jobs[name,color]
jenkins_url + /job/${job_name}/api/json?tree=builds[number,status,timestamp,id,result]
| # 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 |
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.
| 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 |
| # 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 | |
| # | |
| # 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 } |
| # 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=() |
| #! /usr/bin/env ruby | |
| ## rego command to run -- files to watch | |
| # | |
| # rego command_to_run on @ -- {lib/*,test/*} | |
| # | |
| require 'time' | |
| require 'pathname' | |
| require 'rubygems' |