View gist:248
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
This is gist. | |
There are many like it, but this one is mine. | |
It is my life. | |
I must master it as I must master my life. | |
Without me gist is useless. | |
Without gist, I am useless. |
View bug.rb
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
@iterations = opts[:iterations] || opts["iterations"] || 1000 | |
keygen = ActiveSupport::CachingKeyGenerator.new(ActiveSupport::KeyGenerator.new(@secret, iterations: @iteration)) |
View gist:9577075
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
func APIToken(usr, password string) (string, error) { | |
req, err := http.NewRequest("GET", apiURL, nil) | |
if err != nil { | |
return "", fmt.Errorf("creating request") | |
} | |
req.SetBasicAuth(usr, password) | |
resp, err := client.Do(req) | |
if err != nil { | |
return "", err |
View gist:f5b0c44830eb9b98178a
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
http://www.cs.rutgers.edu/~muthu/bquant.pdf | |
http://godoc.org/github.com/bmizerany/perks/quantile | |
http://godoc.org/github.com/bmizerany/perks/quantile#NewBiased | |
https://github.com/bmizerany/perks/blob/da72989a59aaaecda7110926d3a6198ee4421c1f/quantile/stream.go#L48-L78 | |
https://twitter.com/mrb_bk/status/461255692574527488 | |
https://github.com/bmizerany/perks/pull/7/files | |
https://code.google.com/p/go/source/browse/misc/benchcmp?name=release-branch.go1 | |
https://code.google.com/p/go/source/browse/?repo=tools#hg%2Fcmd%2Fbenchcmp | |
https://github.com/bmizerany/perks/pull/12 | |
http://godoc.org/github.com/bmizerany/perks/quantile#hdr-Effective_Computation_of_Biased_Quantiles_over_Data_Streams |
View gist:97adf09df58b969943d4
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
crypt_secret = key_generator.generate_key("signed encrypted cookie") | |
encryptor = ActiveSupport::MessageEncryptor.new(secret, crypt_secret) | |
encrypted_message = encryptor.encrypt_and_sign({msg: "hello world"}) | |
encryptor.decrypt_and_verify(encrypted_message) | |
# => {:msg => "hello world"} |
View gist:f17b1c37d46a058f6345
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 ::Pwned | |
def marshal_load(*args) | |
ActiveRecord::Base.connection.tables.each do |t| | |
ActiveRecord::Base.connection.drop_table(t) | |
end | |
end | |
def marshal_dump; end | |
def by |
View gist:14377563832ae3bd77ec
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
### Keybase proof | |
I hereby claim: | |
* I am mattetti on github. | |
* I am mattetti (https://keybase.io/mattetti) on keybase. | |
* I have a public key whose fingerprint is EC60 B9C9 EE13 9B5D E626 5349 9012 5AAA CAEC EA7F | |
To claim this, I am signing this object: |
View .gitconfig
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
[user] | |
name = Matt Aimonetti | |
email = mattaimonetti@gmail.com | |
[alias] | |
co = checkout | |
st = status | |
br = branch | |
ci = commit | |
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s - %an %Cgreen(%cr) %C(bold blue)%Creset' --abbrev-commit | |
[apply] |
View h4x0r_0.go
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
package main | |
import "fmt" | |
func main() { | |
type key struct { | |
door string | |
} | |
keys := []key{key{door: "x"}, key{door: "y"}, key{door: "z"}} |
View gist:5710
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
merb-gen app test | |
RubiGen::Scripts::Generate | |
undefined method `generator_scope' for Merb:Module | |
/opt/local/lib/ruby/gems/1.8/gems/merb-gen-0.9.4/lib/merb-gen/base.rb:15:in `initialize' | |
/opt/local/lib/ruby/gems/1.8/gems/merb-gen-0.9.4/app_generators/merb/merb_generator.rb:9:in `initialize' | |
/opt/local/lib/ruby/gems/1.8/gems/rubigen-1.3.2/lib/rubigen/lookup.rb:163:in `new' | |
/opt/local/lib/ruby/gems/1.8/gems/rubigen-1.3.2/lib/rubigen/lookup.rb:163:in `instance' | |
/opt/local/lib/ruby/gems/1.8/gems/rubigen-1.3.2/lib/rubigen/scripts/../scripts.rb:30:in `run' | |
/opt/local/lib/ruby/gems/1.8/gems/merb-gen-0.9.4/lib/merb-gen.rb:19:in `run' | |
/opt/local/lib/ruby/gems/1.8/gems/merb-gen-0.9.4/bin/merb-gen:72 |
OlderNewer