Skip to content

Instantly share code, notes, and snippets.

View danmayer's full-sized avatar

Dan Mayer danmayer

View GitHub Profile
@danmayer
danmayer / gist:8816670
Last active August 29, 2015 13:56
client for remote configuring a jenkins
#!/usr/bin/env ruby
require 'jenkins_api_client'
require 'ruby-debug'
CI_PROJECT_NAME = "server_responder"
@client = JenkinsApi::Client.new(:server_ip => 'localhost',
:server_port => '8888',
:username => 'somename',
@danmayer
danmayer / gist:9477044
Created March 11, 2014 00:05
articles about developers and age
http://www.wired.com/wiredenterprise/2013/04/developers-age/
http://www.linkedin.com/today/post/article/20130422020049-8451-the-tech-industry-s-darkest-secret-it-s-all-about-age
http://www.bloombergview.com/articles/2012-04-22/software-engineers-will-work-one-day-for-english-majors
http://heartmindcode.com/2013/08/16/loyalty-and-layoffs/
a counterpoint
http://coding-and-more.blogspot.com/2011/06/its-official-developers-get-better-with.html
a pair, article and a response
http://prog21.dadgum.com/154.html
#specific commiter
git log --numstat --pretty="%H" --author="dan.mayer" --since="2 years ago" app | awk 'NF==3 {plus+=$1; minus+=$2} END {printf("+%d, -%d\n", plus, minus)}
#team total
git log --numstat --pretty="%H" --since="2 years ago" app | awk 'NF==3 {plus+=$1; minus+=$2} END {printf("+%d, -%d\n", plus, minus)}
@danmayer
danmayer / covercheck.rb
Last active August 29, 2015 14:02
Example of Coverage bug causing a problem for Coverband
def method_a
puts "hi"
end
def method_b
puts "boom goes the awesome"
end
method_a
@danmayer
danmayer / gem_updated
Created July 3, 2014 20:20
gem update in progress
GEM_NAME = "ls-secure_gmaps"
COMMIT_MESSAGE = "update to latest ls-secure_gmaps\n This makes sure all calls are made with the correct keys for our new contract"
APPS = ["browse", "browse-service", "escapes", "events", "preferences", "sponsors"]
CMDS = ["git pull origin master",
"bundle install",
"bundle exec rake",
"bundle update #{GEM_NAME}",
"bundle exec rake",
require 'beanstalk-client.rb'
require 'ruby-debug'
DEFAULT_PORT = 11300
SERVER_IP = '127.0.0.1'
#beanstalk will order the queues based on priority, with the same priority
#it acts FIFO, in a later example we will use the priority
#(higher numbers are higher priority)
DEFAULT_PRIORITY = 65536
#TTR is time for the job to reappear on the queue.
require 'sinatra'
EC2_HOME = '~/.ec2'
use Rack::Auth::Basic do |username, password|
[username, password] == ['some_user', 'some_pass']
end
get "/" do
@links = %w{describe_ec2s restart_all_ec2s shutdown_all_ec2s}.map { |cmd|
require 'rubygems'
require 'tlsmail'
require 'time'
content = <<EOF
From: cruise@devver.net
To: contact@devver.net
Subject: Hello!
Date: #{Time.now.rfc2822}
def run_spellcheck(file,interactive=false)
if interactive
cmd = "aspell -p ./config/devver_dictionary -H check #{file}"
puts cmd
system(cmd)
[true,""]
else
cmd = "aspell -p ./config/devver_dictionary -H list < #{file}"
puts cmd
results = `#{cmd}`
require 'rubygems'
require 'dm-core'
require 'aws_sdb'
require 'digest/sha1'
require 'dm-aggregates'
module DataMapper
module Adapters
class SimpleDBAdapter < AbstractAdapter