# Generate THE key
$ openssl genrsa -out mykey.pem 2048
# Generate the private key for the backend
$ openssl pkcs8 -topk8 -inform PEM -outform PEM -in mykey.pem -out private_key.pem -nocrypt
# Generate the public key for iOS
$ openssl rsa -in mykey.pem -pubout -outform DER -out public_key.der
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
# what if… | |
class Config | |
def initialize(path) | |
@data = YAML.parse_file(path) | |
end | |
protected | |
def root_path | |
@root_path ||= @data['app']['root_path'] |
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
#!/usr/bin/env ruby18 -wKU | |
def key_part(line) | |
match = line.match(/^\s*([^:]+)/) | |
return unless match | |
match.captures.first | |
end | |
def leading_spaces(line) | |
line.match(/^(\s*)\S?/).captures.first.length |
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 MethodChainer < BasicObject | |
def initialize(obj, deep_chain = false) | |
@obj = obj | |
@deep_chain = deep_chain | |
end | |
def __ | |
@obj.map { |e| e } | |
end |
[0.72.2]
- Initial version
OlderNewer