This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/[\1]/' | |
} | |
function proml { | |
local BLUE="\[\033[0;34m\]" | |
local RED="\[\033[0;31m\]" | |
local LIGHT_RED="\[\033[1;31m\]" | |
local GREEN="\[\033[0;32m\]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
loop do | |
puts "FOREVER!@!@111" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unless a && b || c | |
do_something | |
else | |
do_something_else | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[15:53][theath@ironman:~/neo/secmgr[master]]$ irb | |
Couldn't load Wirble: cannot load such file -- wirble | |
ruby-head :001 > 1843868956.kind_of?(Fixnum) | |
=> true | |
ruby-head :002 > 1843868956.instance_of?(Fixnum) | |
=> true | |
ruby-head :003 > 1843868956.is_a?(Fixnum) | |
=> true | |
ruby-head :004 > exit | |
[15:54][theath@ironman:~/neo/secmgr[master]]$ ruby -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* jQuery UI Dialog 1.8.16 | |
* | |
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) | |
* Dual licensed under the MIT or GPL Version 2 licenses. | |
* http://jquery.org/license | |
* | |
* http://docs.jquery.com/UI/Dialog | |
* | |
* Depends: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= if((sum(arrayformula(if(sort(split(lower(indirect(address($A2, 6, true, true, "app vulnerabilities"))), " ", false)) = sort(split(lower(indirect(address($B2, 6, true, true, "app vulnerabilities"))), " ", false)), 1, 0))) * 2) = (sum(arrayformula(if(sort(split(lower(indirect(address($A2, 6, true, true, "app vulnerabilities"))), " ", false)) = sort(split(lower(indirect(address($A2, 6, true, true, "app vulnerabilities"))), " ", false)), 1, 0))) + sum(arrayformula(if(sort(split(lower(indirect(address($B2, 6, true, true, "app vulnerabilities"))), " ", false)) = sort(split(lower(indirect(address($B2, 6, true, true, "app vulnerabilities"))), " ", false)), 1, 0)))), VLOOKUP(F1, 'score values'!$A$1:$D$15, 2, false), min(sum(arrayformula(if(sort(split(lower(indirect(address($A2, 6, true, true, "app vulnerabilities"))), " ", false)) = sort(split(lower(indirect(address($B2, 6, true, true, "app vulnerabilities"))), " ", false)), 1, 0))) * VLOOKUP(F1, 'score values'!$A$1:$D$15, 3, false), VLOOKUP(F1, 'score values'!$A$1: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contact.search do | |
all do | |
first_name 'Jen' | |
last_name 'Lee' | |
buying_terry_beer 'yes' | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In case y'all wanted to play with it - I'm working on getting a shitload of data into the index to see how aggressively we need to look into this. We should also compare numbers y'all are seeing vs the ones I am, since I'm running everything locally and don't have the same VM I/O performance issues that you might be running into (which might be a big deal if we host a lot of instances on VMs) | |
https://github.com/bhb/rack-perftools_profiler | |
I think the VM I/O performance is worth evaluating a little more (probably not before the dupe logic stuff or getting a proper CI environment or anything, but by end of 2011). Here are some (admittedly, older) posts about VM I/O: | |
http://www.codinghorror.com/blog/2006/10/the-single-most-important-virtual-machine-performance-tip.html | |
http://www.codinghorror.com/blog/2005/02/virtual-pc-2004-tips.html | |
http://www.hanselman.com/blog/CommentView.aspx?guid=097ce75a-838a-4511-a858-d6de8e8e78a9 | |
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&exter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class JiraTicket | |
def hello_there | |
"hello there" | |
end | |
end | |
jt = JiraTicket.new | |
puts "hello there: #{jt.hello_there}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
form_names = AdHocTemplate.active.map(&:canonical_name) | |
states = %w(pending in_progress submitted) | |
Contact.all.each do |c| | |
form_names.each do |form| | |
forms = AdHocForm.where(:template_canonical_name => form, :contact_id => c.id).all | |
next if forms.empty? | |
forms = forms.to_a.sort{|a, b| states.index(a.aasm_state) <=> states.index(b.aasm_state)} | |
forms.pop | |
forms.each{|f| f.destroy} |