Skip to content

Instantly share code, notes, and snippets.

View jtimberman's full-sized avatar
🚀

Joshua Timberman jtimberman

🚀
View GitHub Profile
@jtimberman
jtimberman / nix.rb
Last active December 16, 2015 07:39 — forked from dysinger/nix.sh
remote_file "/tmp/nix-1.5.1-x86_64-linux.tar.bz2" do
source "http://hydra.nixos.org/build/4253979/download/1/nix-1.5.1-x86_64-linux.tar.bz2"
notifies :run, "execute[untar nix]", :immediately
end
execute "untar nix" do
cwd "tmp"
command "tar -jxf /tmp/nix-1.5.1-x86_64-linux.tar.bz2 -C /"
action :nothing
notifies :run, "execute[nix-finish-install]"
@jtimberman
jtimberman / .jira
Last active December 15, 2015 19:59 — forked from miketheman/clformat.rb
{"username": "YOUR_JIRA_NAME", "pw": "YOUR_JIRA_PW"}

Immutable Ruby

Libraries I talked about

  • ice_nine: Deep freeze ruby objects
  • Values: Simple immutable value objects for ruby
  • immutable_attributes: specify attributes within an ActiveRecord model that can be set but not modified
  • hamster: Efficient, Immutable, Thread-Safe Collection classes for Ruby

Next Steps

@jtimberman
jtimberman / default.rb
Last active December 14, 2015 14:59 — forked from adamhjk/default.rb
#
# Cookbook Name:: apache
# Recipe:: default
#
# Copyright 2012, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
#
package "apache2" do
#!/usr/bin/env ruby
recipe_path = ARGV[0]
if recipe_path.nil?
STDERR.puts "usage: chef-apply RECIPE_FILE"
exit 1
end
recipe_path = File.expand_path(recipe_path)
default[:graphite][:storage_aggregation] => [
{
:sum => {
:pattern=> "\.count$",
:xFilesFactor => "0",
:aggregationMethod => "sum"
}
},
{
:avg => {
@jtimberman
jtimberman / polluted.rb
Created November 8, 2012 17:21 — forked from ahoward/polluted.rb
ruby libs have *got* to stop doing this...
libs = ARGV.size == 0 ? all_gems : ARGV
list =
libs.
forkify(16){|lib| puts "#{ lib }..."; [lib, polluted_by(lib)]}.
sort_by{|pair| pair.last}
list.each do |lib, polluted|
puts "polluted_by('#{ lib }') #=> #{ polluted }"
@jtimberman
jtimberman / github.js.diff
Created September 8, 2012 20:37 — forked from ctdk/github.js.diff
Diff to fix Octopress' github.js to make it not use the deactivated Github v2 API
diff --git a/source/javascripts/github.js b/source/javascripts/github.js
index 678775a..bc4c9bd 100644
--- a/source/javascripts/github.js
+++ b/source/javascripts/github.js
@@ -3,22 +3,22 @@ var github = (function(){
var i = 0, fragment = '', t = $(target)[0];
for(i = 0; i < repos.length; i++) {
- fragment += '<li><a href="'+repos[i].url+'">'+repos[i].name+'</a><p>'+repos[i].description+'</p></li>';
+ fragment += '<li><a href="'+repos[i].html_url+'">'+repos[i].name+'</a><p>'+repos[i].description+'</p></li>';
cookbook "java" do
configuration("openjdk") { runtimes [] }
configuration("oracle") { runtimes [] }
runtimes []
end
@jtimberman
jtimberman / macosx_bootstrap.sh
Created August 9, 2012 04:55 — forked from fnichol/macosx_bootstrap.sh
Mac OS X 10.7/10.8 (Lion/Mountain Lion) Bootstrapping
#!/usr/bin/env bash
set -e
# # Mac OS X 10.7/10.8 (Lion/Mountain Lion) Bootstrapping
#
# ## Pre-requisites
#
# 1. Set your hostname: In **System Preferences** go to **Sharing** and enter
# the name in **Computer Name**
# 2. Run **Software Update** and reboot if necessary