Skip to content

Instantly share code, notes, and snippets.

@mmack
mmack / gist:1122092
Created August 3, 2011 07:22
Silicon Valley
<iframe src="about:blank" frameborder="0" id="shimmer" style="display:none;"></iframe>
@mmack
mmack / gist:1315863
Created October 26, 2011 09:22
ruby regex
ruby-1.9.2-p290 :059 > u = "validusername"
=> "validusername"
ruby-1.9.2-p290 :060 > u !~ /^[a-z0-9\-_]$/
=> true
ruby-1.9.2-p290 :061 > u = "not a valid.username"
=> "not a valid.username"
ruby-1.9.2-p290 :062 > u !~ /^[a-z0-9\-_]$/
=> true
@mmack
mmack / Gemfile.lock
Created November 9, 2011 08:43
Gemfile
GIT
remote: git://github.com/chriseppstein/compass.git
revision: 616af1c1398ed6cf53ce6e2c2f0064848cc96e51
specs:
compass (0.12.alpha.0.616af1c)
chunky_png (~> 1.2)
fssm (>= 0.2.7)
sass (~> 3.1)
GIT
"took": 3,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 1.0,
{12-02-28 16:49}[ruby-1.9.3]maxbookpro:~/workspace/dozeo/payments@topic-new-database-layout2✗✗✗ max% rspec spec/api/controllers/payments_controller_spec.rb
:public is no longer used to avoid overloading Module#public, use :public_folder instead
from /Users/max/.rvm/gems/ruby-1.9.3-p0/gems/resque-1.19.0/lib/resque/server.rb:12:in `<class:Server>'
/Users/max/workspace/dozeo/payments/models/payment.rb:2: [BUG] Segmentation fault
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]
-- Control frame information -----------------------------------------------
c:0036 p:---- s:0134 b:0134 l:000133 d:000133 CFUNC :inspect
c:0035 p:---- s:0132 b:0132 l:000131 d:000131 CFUNC :inspect
c:0034 p:0030 s:0129 b:0128 l:000127 d:000127 CLASS /Users/max/workspace/dozeo/payments/models/payment.rb:2
@mmack
mmack / gist:3188443
Created July 27, 2012 14:45
adudio 1
<--- SIP read from UDP:127.0.0.1:47475 --->
BYE sip:6mzh1mp0345av4smgbjiy9ru2@127.0.0.1:5060 SIP/2.0
Content-Length: 0
Via: SIP/2.0/UDP 10.3.186.15:47475;rport;branch=z9hG4bKOo_VR_N-UBXujgveCT6nvg..
From: "4521f414d4503e22672fcd85261fa7af" <sip:4521f414d4503e22672fcd85261fa7af@127.0.0.1>;tag=54930742562
To: <sip:6mzh1mp0345av4smgbjiy9ru2@127.0.0.1>;tag=as4aeb0764
Contact: <sip:4521f414d4503e22672fcd85261fa7af@10.3.186.15:47475>
CSeq: 2 BYE
Max-Forwards: 70
test
require "awesome_print"
def make_hash(keys, value)
keys.empty? ? value : { keys.shift => make_hash(keys, value) }
end
data = {
"80e33bc0-1b9a-0130-d2fb-38f6b113e413:data:message:name" => "max",
"80e33bc0-1b9a-0130-d2fb-38f6b113e413:data:text" => "bla",
"80e33bc0-1b9a-0130-d2fb-38f6b113e413:data:message:line:x" => 123
@mmack
mmack / gist:4634968
Last active December 11, 2015 17:29
{
"points": {
"point": [
{
"ip": "178.125.193.227",
"color": "66FF33"
},
{
"ip": "176.74.60.251"
},
@mmack
mmack / gist:5283903
Created April 1, 2013 08:51
ruby ruby 2.0.0p0 segfault
Started GET "/sidekiq/scheduled" for 127.0.0.1 at 2013-04-01 10:49:06 +0200
/Users/mmack/.rvm/gems/ruby-2.0.0-p0/gems/tilt-1.3.6/lib/tilt/template.rb:227: [BUG] Segmentation fault
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.2.1]
-- Crash Report log information --------------------------------------------
See Crash Report log file under the one of following:
* ~/Library/Logs/CrashReporter
* /Library/Logs/CrashReporter
* ~/Library/Logs/DiagnosticReports
* /Library/Logs/DiagnosticReports