This file contains hidden or 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 Magic | |
def property types, method_name, property_name = nil | |
property_name = method_name if property_name.nil? | |
# reader | |
self.class.send :define_method, method_name do | |
value = read_value property_name | |
raise unless types.any? do |type| | |
value.is_a? type |
This file contains hidden or 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
irb(main):001:0> module A; def a; puts 'a'; end; end | |
=> nil | |
irb(main):002:0> module B; def a; puts 'b'; end; end | |
=> nil | |
irb(main):003:0> class Blah; include A; include B; end | |
=> Blah | |
irb(main):004:0> Blah.new.a() | |
b |
This file contains hidden or 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
# Additional translations at http://github.com/plataformatec/devise/wiki/I18n | |
# Devise v1.4.6 polish translation by saepia based on @rogal111's translation | |
# Devise 2.0.0 updates by @kszksz | |
# Language updates by @Nowaker - bardziej zrozumiałe instrukcje (np. unconfirmed - sama informacja, że konto jest | |
# nieaktywne nie jest wystarczająca - trzeba powiedzieć, co trzeba zrobić by je aktywować), bardziej naturalne zwroty | |
# (unikanie strony biernej, więcej emocji w witaniu itp.), zakomentowanie zdeprecjonowanych wiadomości, | |
# dodanie "update_needs_confirmation" (Devise 2.0.1?) | |
pl: | |
errors: |
This file contains hidden or 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
var http = require("http") | |
, util = require("sys") // 0.3.x: require("util") | |
, fs = require("fs") | |
, client = http.createClient(80, "example.com") | |
, request = client.request("POST", "/", {"host":"example.com"}) | |
// send body chunks | |
request.write("hello, world") | |
// pump a file through |
This file contains hidden or 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
#!/usr/bin/env node | |
var spdy = require('spdy'), | |
crypto = require('crypto'), | |
fs = require('fs'); | |
b64decode = function(encoded) { | |
return new Buffer(encoded || '', 'base64').toString('utf8'); | |
}; |
This file contains hidden or 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
# Create your superuser | |
$ mongo | |
> use admin | |
> db.createUser({user:"someadmin",pwd:"secret", roles:[{role:"root",db:"admin"}]}) | |
> exit | |
# Alias for convenience (optional and at your own risk) | |
$ echo 'alias mongo="mongo --port 27017 -u someadmin -p secret --authenticationDatabase admin"' >> ~/.bash_profile | |
$ source ~/.bash_profile |
This file contains hidden or 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 Nowaker on github. | |
* I am nowaker (https://keybase.io/nowaker) on keybase. | |
* I have a public key whose fingerprint is 7205 280D 7BF0 E93E 4698 584F 9F14 E954 D7BC 8F6F | |
To claim this, I am signing this object: |
This file contains hidden or 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
{ | |
"items": [{ | |
"name": "gp1.subsonic", | |
"links": [{ | |
"href": "https://iad2.dream.io:8774/v2/4bf0011c1ae9448f8a1ad1cb25159eb4/flavors/100", | |
"rel": "self" | |
}, { | |
"href": "https://iad2.dream.io:8774/4bf0011c1ae9448f8a1ad1cb25159eb4/flavors/100", | |
"rel": "bookmark" | |
}], |