I hereby claim:
- I am mathiasjakobsen on github.
- I am mathiasjakobsen (https://keybase.io/mathiasjakobsen) on keybase.
- I have a public key whose fingerprint is 32FF 91BD 81D8 8D52 B192 2A12 196B FB80 362C 6EE2
To claim this, I am signing this object:
| Types::FoosType = GraphQL::ObjectType.define do | |
| field :foos, !types[Types::FooType] do | |
| timed true # enable New Relic trace_execution_scoped | |
| description "Returns foos" | |
| argument :per, types.Int, default_value: 20 | |
| argument :page, types.Int, default_value: 1 | |
| # Moving to cursor pagination would be better | |
| resolve(...) | |
| end | |
| end |
| Our whole universe was in a hot dense state, | |
| Then nearly fourteen billion years ago expansion started. Wait... | |
| The Earth began to cool, | |
| The autotrophs began to drool, | |
| Neanderthals developed tools, | |
| We built a wall (we built the pyramids), | |
| Math, science, history, unraveling the mystery, | |
| That all started with the big bang (bang)! | |
| "Since the dawn of man" is really not that long, |
| After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work. | |
| The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0." | |
| Database files have to be updated before starting the server, here are the steps that had to be followed: | |
| # need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default | |
| brew unlink postgresql | |
| brew install postgresql@9.6 | |
| brew unlink postgresql@9.6 | |
| brew link postgresql |
| // { "-70": "", "-69": "", ... "-1": "" } | |
| Object.assign(...Array(70).fill().map((_, i) => -(i + 1)).reverse().map(i => ({[i]: ''}))) |
| #!/usr/bin/env bash | |
| # This is a modified version of @kremalicious's original script (https://kremalicious.com/simple-tor-setup-on-mac-os-x/) | |
| # The script was hardcoded to a specific network interface. Now it's not ¯\_(ツ)_/¯ | |
| # Resolve the current network interface identifier | |
| SERVICES=$(networksetup -listnetworkserviceorder | grep 'Hardware Port') | |
| while read line; do |
| // This example shows how to render pages that perform AJAX calls | |
| // upon page load. | |
| // | |
| // Instead of waiting a fixed amount of time before doing the render, | |
| // we are keeping track of every resource that is loaded. | |
| // | |
| // Once all resources are loaded, we wait a small amount of time | |
| // (resourceWait) in case these resources load other resources. | |
| // | |
| // The page is rendered after a maximum amount of time (maxRenderTime) |
| module BinarySearchTree | |
| class Node | |
| attr_reader :value | |
| attr_accessor :left, :right, :count | |
| def initialize(v) | |
| @value = v | |
| @count = 1 | |
| end |
| # Initilize an array containing plucked property of each hash in array | |
| array_of_hashes = [] << array_of_hashes.map(&:hash_property) | |
| # Generate a random alphanumeric string, with a fixed length | |
| [*('a'..'z'), *('0'..'9')].sample(15).join | |
| # Find average of list of intergers, read from STDIN | |
| avg, n = 0.0, 1.0 | |
| arr = STDIN.read.split("\n").map(&:to_i) | |
| arr.each { |i| avg = (n - 1) / n * avg + i / n; n += 1.0 } |
I hereby claim:
To claim this, I am signing this object: