Skip to content

Instantly share code, notes, and snippets.

@ChrisLundquist
ChrisLundquist / bundle_differ.rb
Last active December 27, 2015 03:29
Generate pretty reports of Gemfile.lock.diffs
#!/usr/bin/env ruby
# Pretty print how the versions of gems changed between diffs of Gemfile.lock
# usage: ./bundle_differ.rb path/to/Gemfile.lock.diff
#
# Example Output:
# ffi 1.9.0 -> 1.9.3
# guard 2.1.1 -> 2.2.2
# jquery-ui-rails 4.0.5 -> 4.1.0
# listen 2.1.1 -> 2.2.0
# uglifier 2.2.1 -> 2.3.0
tell application "System Events"
set visible of process "StarCraft II" to true
end tell
do shell script "open \"/Users/clundquist/Library/Application Support/Blizzard/StarCraft II/Accounts/1454200/1-S2-1-501405/Replays/Multiplayer/Derelict Watcher TE (208 Balance v11).SC2Replay\""
delay 2
tell application "QuickTime Player"
set replayRecording to new screen recording
private
def set_platform_default_providers
if node.platform_family?(['debian', 'rhel'])
Chef::Platform.set(
:platform => node.platform.to_sym,
:resource => :firewall,
:provider => Chef::Provider::FirewallIptables
)
end
end
#!/usr/bin/env bats
@test "the log dir (<%= node.example.log_dir %>) should be owned by our user (<%= node.example.user %>)" {
[ "$(stat -c %U | grep <%= node.example.user %>)" ]
}
@test "should create the log dir (<%= node.example.log_dir %>)" {
[ -d <%= node.example.log_dir %> ]
}
{ "run_list": [ "recipe[redis]"] }
Generated at 2013-02-07 15:34:41 -0800
NoMethodError: undefined method `run_list_for' for {"run_list"=>["recipe[graphite]"]}:Hash
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.2.0/lib/chef/run_list/run_list_expansion.rb:151:in `expand_run_list_items'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.2.0/lib/chef/run_list/run_list_expansion.rb:84:in `expand'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.2.0/lib/chef/run_list.rb:139:in `expand'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.2.0/lib/chef/node.rb:326:in `expand!'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.2.0/lib/chef/client.rb:331:in `expand_run_list'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.2.0/lib/chef/client.rb:289:in `build_node'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.2.0/lib/chef/client.rb:459:in `do_run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.2.0/lib/chef/client.rb:200:in `run'
@ChrisLundquist
ChrisLundquist / gist:4358358
Created December 22, 2012 10:19
chef-rbenv 0.7.0 bug
[2012-12-22T09:13:29+00:00] INFO: Processing git[/usr/local/rbenv] action checkout (rbenv::system_install line 61)
[2012-12-22T09:13:34+00:00] INFO: git[/usr/local/rbenv] cloning repo git://github.com/sstephenson/rbenv.git to /usr/local/rbenv
[2012-12-22T09:13:40+00:00] INFO: git[/usr/local/rbenv] checked out branch: master reference: c3fe192243bff9a00866d81af38d9012bfba419a
[2012-12-22T09:13:40+00:00] INFO: Processing bash[Initialize rbenv (system)] action run (rbenv::system_install line 80)
================================================================================
Error executing action `run` on resource 'bash[Initialize rbenv (system)]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
$ jamie test
-----> Cleaning up any prior instances of default-centos6
-----> Destroying instance default-centos6
[vagrant command] 'vagrant destroy default-centos6 -f'
[default-centos6] VM not created. Moving on...
[vagrant command] ran in 1.2300000000000009 seconds.
Destruction of instance default-centos6 complete.
-----> Testing instance default-centos6
-----> Creating instance default-centos6
[vagrant command] 'vagrant up default-centos6 --no-provision'
$ ruby -v
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin14]
Rehearsal --------------------------------------------------------------
map_compact 0.020000 0.000000 0.020000 ( 0.015315)
map_inplace_compact 0.010000 0.000000 0.010000 ( 0.016069)
reject_map 0.010000 0.000000 0.010000 ( 0.014038)
reject_inplace_map 0.860000 0.010000 0.870000 ( 0.860999)
reject_map_inplace 0.010000 0.000000 0.010000 ( 0.013710)
reject_inplace_map_inplace 0.860000 0.000000 0.860000 ( 0.866945)
@ChrisLundquist
ChrisLundquist / magicka.lua
Created January 29, 2011 04:32
Magicka G15 script / macro
-- To use this script
-- 1) copy and paste this body into the script editor window and save it.
-- 2) Set each G Key in each M mode (that you want to use) to "script"
-- NOTE: Only G1 - G6 are configured since I am using the orange G15,
-- Extending this to 18 is just copy and paste.
-- If you are trying to record macros and they are not working, make sure you have
-- the record delay checkbox checked, however I find this script works better and
-- is more flexible than recording each macro by hand and adjusting the delay.