Skip to content

Instantly share code, notes, and snippets.

View superscott's full-sized avatar
👺
щ(ಠ益ಠщ) (✖╭╮✖) ᕦ(ò_óˇ)ᕤ

superscott superscott

👺
щ(ಠ益ಠщ) (✖╭╮✖) ᕦ(ò_óˇ)ᕤ
View GitHub Profile
@superscott
superscott / onetime_playbook.yml
Created October 9, 2014 22:16
initial* shellshock bash test for ansible
---
- hosts: all
sudo: True
gather_facts: no
tasks:
- command: env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
register: output
- debug: var=output
@superscott
superscott / gist:3897081
Created October 16, 2012 03:18
Rails Date.today oddity
Ruby 1.9.2 -- Rails 3.2.8
1.9.2p320 :001 > Date.today
=> Mon, 15 Oct 2012
1.9.2p320 :002 > Date.tomorrow
=> Wed, 17 Oct 2012
1.9.2p320 :003 > Date.yesterday
=> Mon, 15 Oct 2012
1.9.2p320 :004 > Time.zone
=> (GMT+00:00) UTC
@superscott
superscott / gist:3908076
Created October 17, 2012 20:47
two arrays as hash
saturday.each_with_index { |k,i| datehash[k] = friday[i] }
saturday (array one)
datehash (resulting hash)
friday (array two)
def data_links_helper(data, model)
output = ""
for report in data
output << "<tr>"
report.each do |k,v|
output << "<td>#{v}</td>"
end
@select_options = { "value" => "value", "name" => "name" }
<%= select_tag 'group_by', options_from_collection_for_select(@select_options, "value", "name") %>
asd = Price.where("min_color <= ? AND min_qty <= ? ", 1, 34)
def self.clean(value, level)
case level
when 1 #strip html and tags
results = Sanitize.clean(value)
when 2 #includes level 1, regex to allow symbols
leveltwo = Sanitize.clean(value)
leveltwo.strip!
results = leveltwo.gsub(/[^0-9a-zA-Z\(\)\|\:\/\,\'\.\-\@\_\[\]\&\?\=\s]/, "")
Netflix Keynote:
@caseyrosethal
AWS - three regions. (US-W, US-E, EU)
300 + Microservices :: Dev ownership includes Deployment and Uptime
Software is getting more complex:
--how we interact with software
mobile. IoT. rapid rate of change.
@superscott
superscott / gem_make.out
Last active December 14, 2015 08:49
gem install error?
cat /Users/.rvm/gems/ruby-2.0.0-p0@gems/gems/therubyracer-0.11.4/ext/v8/gem_make.out
/Users/.rvm/rubies/ruby-2.0.0-p0/bin/ruby extconf.rb
checking for main() in -lpthread... yes
checking for main() in -lobjc... yes
creating Makefile
make
compiling accessor.cc
accessor.cc:1: error: bad value (corei7) for -march= switch
accessor.cc:1: error: bad value (corei7) for -mtune= switch
@superscott
superscott / gist:5085435
Created March 4, 2013 20:39
remove formatting on numbers.
Example:: v.first == "1,000" or v.first == "$15,000.00"
<td>
<div>
<span title=<%= !v.first.nil? ? v.first.gsub(',', '') : nil %>></span>
<% v.each do |col_value| %>
<%= col_value %>
<% end %>
</div>
</td>