Skip to content

Instantly share code, notes, and snippets.

View workmad3's full-sized avatar

David Workman workmad3

View GitHub Profile
@workmad3
workmad3 / profile_selector.vba
Last active August 21, 2018 16:35
Customer Profile Selector
Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
Dim wsSheet As Worksheet
Application.ScreenUpdating = False
Select Case Range("H5")
Case "Hain"
For Each wsSheet In Worksheets
wsSheet.Visible = xlSheetHide
If wsSheet.Name Like "*Hain*" Or wsSheet.Name = "Customer Contacts" Or wsSheet.Name = "Retail Overview" Or wsSheet.Name = "Strategies & Decision Criteria" Or wsSheet.Name = "Leadtimes" Or wsSheet.Name = "Scorecard" Or wsSheet.Name = "Select Client Profile" Then
@workmad3
workmad3 / timer.rb
Last active June 7, 2017 09:26 — forked from universal/timer.rb
def start_request
method = http.post :body => { data: { serial_no: serial } }
method.errback do
yield
$stderr.puts 'Can\'t connect to cloud'
end
method.callback do
yield
p method.response_header.status
# add to Gemfile
gem 'decent_exposure' # https://github.com/voxdolo/decent_exposure
gem 'responders' # https://github.com/plataformatec/responders
#temporary for testing
## move the response file into your recipe as either a template or cookbook file
##FileUtils.cp(node[:response_file], File.join("#{tmpDir}","client"))
cookbook_file "#{tmp_dir}/oracle_response_file"
execute "oracleInstall" do
command "#{tmpDir}/client/setup.exe -silent -responseFile \"#{tmpDir}/client/Oracle11gR2_rsp.rsp\" -logLevel finest -ignoreSysPrereqs -noconsole"
action :run
not_if { ::File.exists?("C:/oracle/product/11.2.0/client_1/bin") }
@workmad3
workmad3 / after.vimrc
Last active December 28, 2015 16:39 — forked from anonymous/after.vimrc
" Extra packages {{{
Bundle "nono/vim-handlebars"
Bundle "leshill/vim-json"
Bundle "tpope/vim-bundler"
Bundle "fholgado/minibufexpl.vim"
Bundle "wavded/vim-stylus"
Bundle "altercation/vim-colors-solarized"
Bundle 'AutoTag'
Bundle "SuperTab"
" }}}
@workmad3
workmad3 / comment..rb
Last active December 27, 2015 12:49 — forked from andyh/comment..rb
def self.create_from_parent(parent_type, parent_id, comment_params, current_account)
parent = parent_type.constantize
raise ActiveRecord::RecordNotFound unless parent.reflect_on_association(:comments).klass == self
parent.find(parent_id).comments.create(comment_params.merge(account: current_account))
rescue NameError
raise ActiveRecord::RecordNotFound
end
@workmad3
workmad3 / gist:7218203
Last active December 26, 2015 21:49 — forked from anonymous/gist:7218182
<%= link_to "passes/Tara-Evans-01-10-2013.jpg", class: "example-image-link", data: {lightbox: "gallery"}, title: "Well done Tara, first time with only one minor" do %>
<%= image_tag("passes/Tara-Evans-01-10-2013.jpg", alt: "Tara Evans", width: "220", height: "147")%>
<p>
Tara Evans <br />
Passed 1 October 2013
</p>
</a>
@workmad3
workmad3 / riak_wrapper.rb
Last active December 25, 2015 20:09 — forked from gerep/riak_wrapper.rb
class RiakWrapper
def initialize
walk_server = WalkServer.first
@client = Riak::Client.new(:protocol => "pbc", :host => walk_server.host, :pb_port => walk_server.pb_port)
end
def exists?(key, bucket_name)
bucket(bucket_name).exists?(key)
end
Failures:
1) Micropost should not be valid when user_id is not present
Failure/Error: it { should_not be_valid }
expected #<Micropost id: 1, content: "lorem ipsum", user_id: 1, created_at: "2013-10-09 11:10:10", updated_at: "2013-10-09 11:10:10"> not to be valid
respond_to do |format|
format.html
format.xls do
render :xls => "some_filename", :template => "reports/#{params[:id]}.xls.writeexcel"
end
end