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
| System.cmd("npm", ["run", "watch", "--prefix", "assets"], stderr_to_stdout: true, into: IO.stream(:stdio, :line)) |
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 sorentwo on github. | |
| * I am sorentwo (https://keybase.io/sorentwo) on keybase. | |
| * I have a public key whose fingerprint is 9A47 77D5 4D4D 16A1 AAB1 A62D AE4E 59A6 0C64 50AA | |
| 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
| require 'readthis/expanders' | |
| require 'perforated' | |
| class PerforatedSerializer | |
| attr_reader :relation, :scope, :serializer, :options | |
| def initialize(relation, options = {}) | |
| @relation = relation | |
| @scope = options.fetch(:scope) | |
| @serializer = options.fetch(:each_serializer) |
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 extend = require('./utils/extend'); | |
| var merge = require('./utils/merge'); | |
| var mixin = require('./utils/mixin'); | |
| var EventEmitter = require('events').EventEmitter; | |
| var Model = function(attributes, options) { | |
| mixin(this); | |
| options = options || {}; |
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
| Calculating ------------------------------------- | |
| oj:hash:dump 1.047k i/100ms | |
| json:hash:dump 833.000 i/100ms | |
| ruby:hash:dump 719.000 i/100ms | |
| ------------------------------------------------- | |
| oj:hash:dump 10.622k (± 6.5%) i/s - 53.397k | |
| json:hash:dump 8.478k (± 5.0%) i/s - 42.483k | |
| ruby:hash:dump 7.376k (± 6.7%) i/s - 37.388k | |
| Comparison: |
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
| -- bgwriter | |
| SELECT checkpoints_timed FROM pg_stat_bgwriter; | |
| SELECT checkpoints_req FROM pg_stat_bgwriter; | |
| SELECT write_time FROM pg_stat_bgwriter; | |
| SELECT sync_time FROM pg_stat_bgwriter; | |
| SELECT buffers_checkpoint FROM pg_stat_bgwriter; | |
| SELECT buffers_clean FROM pg_stat_bgwriter; | |
| SELECT maxwritten_clean FROM pg_stat_bgwriter; | |
| SELECT buffers_backend FROM pg_stat_bgwriter; | |
| SELECT buffers_backend_fsync FROM pg_stat_bgwriter; |
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 CORSHeaders | |
| ACCESS_CONTROL_HEADERS = { | |
| 'Access-Control-Allow-Origin' => '*', | |
| 'Access-Control-Allow-Methods' => 'OPTIONS,GET,PATCH,PUT,POST,DELETE', | |
| 'Access-Control-Expose-Headers' => '', | |
| 'Access-Control-Max-Age' => '1728000', | |
| 'Content-Type' => 'text/plain' | |
| }.freeze | |
| def initialize(app) |
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
| WITH linked AS ( | |
| SELECT id, | |
| lead(id) OVER(ORDER BY id DESC) AS next_id, | |
| lag(id) OVER(ORDER BY id ASC) AS prev_id | |
| FROM snippets | |
| WHERE snippets.mission_id = $1 | |
| ) | |
| SELECT snippets.* FROM snippets, linked WHERE linked.id = $2 AND snippets.id = linked.next_id; |
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
| The first pass writes and the second pass reads. | |
| 10_000 Objects: | |
| user system total real | |
| memory-1 1.240000 0.010000 1.250000 ( 1.252629) | |
| memory-2 0.110000 0.000000 0.110000 ( 0.114169) | |
| redis-1 1.930000 0.230000 2.160000 ( 2.300067) | |
| redis-2 0.210000 0.010000 0.220000 ( 0.222959) | |
| dalli-1 1.470000 0.090000 1.560000 ( 1.574031) |