POST http://backend_url/android_offers/generate
{ user_id: 2112 }
200 OK
{
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
# Create Partition Table | |
echo "Create Partition Table" | |
gpart create -s gpt mfid0 | |
gpart create -s gpt mfid1 | |
# Create Boot Partition | |
echo "Create Boot Partition" | |
gpart add -a 4k -s 64k -t freebsd-boot mfid0 | |
gpart add -a 4k -s 64k -t freebsd-boot mfid1 |
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
require "benchmark" | |
require "bigdecimal" | |
require "bigdecimal/util" | |
Benchmark.bm do |x| | |
class Foo | |
VALUE = BigDecimal("1.2") | |
def to_d | |
VALUE |
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
require "pstore" | |
require "json" | |
class JSON::Store < PStore | |
def dump(table) | |
# use JSON.pretty_generate(table) to make it even more human readable | |
JSON.generate(table) | |
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
Calculating ------------------------------------- | |
rails 688 i/100ms | |
rails_default 1496 i/100ms | |
manual 1875 i/100ms | |
------------------------------------------------- | |
rails 7165.7 (±1.0%) i/s - 72240 in 10.082247s | |
rails_default 16039.7 (±1.0%) i/s - 161568 in 10.074064s | |
manual 20281.0 (±1.7%) i/s - 204375 in 10.080226s | |
Comparison: |
In order to make pairing very efficient I always found a code styleguide very helpful to minimize discussions around code style.
The goal is to keep code highly readable under any circumstances. Contributing and adhering to this styleguide will help improve overall code readability.
A good reference to set discussions around unwritten rules: https://github.com/bbatsov/ruby-style-guide
Order Request:
POST /orders HTTP/1.1
Host: api.point101.com
Content-Type: application/json
X-App-ID: simplybuy.it
X-App-Token: deadbeef123
X-HMAC: abc1234567890
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
// pretty awesome function to get a path to any given element | |
function pathToNode(node) { | |
if (node.id.length > 0) { return "#" + node.id; } | |
var path = []; | |
var parents = $(node).parents().toArray().reverse(); | |
var deferred = $.Deferred(); | |
var self = this; | |
function qualifiers(node) { | |
if (node.id.length > 0) { | |
return "#" + node.id; |
OlderNewer