Skip to content

Instantly share code, notes, and snippets.

View stevendaniels's full-sized avatar
👋

Steven Daniels stevendaniels

👋
View GitHub Profile
@stevendaniels
stevendaniels / 1
Last active August 14, 2017 12:40 — forked from mbostock/.block
Scatterplot
Scatterplot example
@stevendaniels
stevendaniels / two_branch_cleanup_scripts.sh
Created August 22, 2016 20:37 — forked from Emuentes/two_branch_cleanup_scripts.sh
SCRIPT-ONE: will print the names of the branches that have been merged into develop AND master in green. Also, branches that are only merged into develop but not master are listed in red. ---- SCRIPT-TWO: will delete the fully merged branches, those listed in green when you run SCRIPT-ONE
#######################################
# SCRIPT 1 - PREVIEW BRANCH DELETIONS #
#######################################
# will print the names of the branches that have been merged into develop and master in green and branches that are only merged into develop but not master in red.
BRANCHES_IN_MASTER=`git branch -r --merged origin/master | grep -v -E '(\*|master$|develop$)' | cut -f2- -d '/' | tr '\n' ';'` && export BRANCHES_IN_MASTER && git branch -r --merged origin/develop | grep -v -E '(\*|master$|develop$)' | cut -f2- -d '/' | xargs -L1 bash -c 'if [ $(grep -o "$0" <<< "$BRANCHES_IN_MASTER" | wc -l) -gt 0 ] ; then printf "\e[0;32m $0 \e[0m\n"; else printf "\e[0;31m $0 is merged into DEVELOP but not MASTER \e[0m\n"; fi';
#################################################################################################################################
# SCRIPT 2 - DANGER -- RUN AT YOUR OWN RISK -- The following script will DELETE the branches listed in the above preview script #
###########################
@stevendaniels
stevendaniels / bm_dci_pounding.rb
Created March 30, 2016 11:32 — forked from raggi/bm_dci_pounding.rb
Show the effects of method cache damage from runtime extend, as it relates to extend vs. delegate for DCI.
require 'benchmark'
number_of_rails_methods = 300
@rails = Class.new do
number_of_rails_methods.times do |i|
class_eval <<-RUBY
def call#{"%02d" % i} # def call01
end # end
RUBY
@stevendaniels
stevendaniels / roo_error.irb
Last active December 11, 2017 19:40 — forked from reshleman/irb
Roo Bug Report
irb(main):001:0> require "roo"
=> true
irb(main):002:0> require "roo/version"
=> true
irb(main):003:0> Roo::VERSION
=> "2.0.0"
irb(main):004:0> sheet = Roo::Spreadsheet.open("/Users/reshleman/Desktop/roo_error.xlsx", extension: "xlsx")
=> {[1, 1]=>#<Roo::Excelx::Cell:0x007fe6b297fef0 @type=:string, @formula=nil, @excelx_type=:string, @excelx_value="0", @style=0, @value="name", @coordinate=#<Roo::Excelx::Cell::Coordinate:0x007fe6b297ff40 @row=1, @column=1>>, [2, 1]=>#<Roo::Excelx::Cell:0x007fe6b297f798 @type=:string, @formula=nil, @excelx_type=:string, @excelx_value="1", @style=0, @value="Robert Eshleman", @coordinate=#<Roo::Excelx::Cell::Coordinate:0x007fe6b297f7e8 @row=2, @column=1>>}
irb(main):005:0> sheet.parse(name: "name")
=> [{:name=>"name"}, {:name=>"Robert Eshleman"}]