I hereby claim:
- I am eoinkelly on github.
- I am eoinkelly (https://keybase.io/eoinkelly) on keybase.
- I have a public key whose fingerprint is 05FB 2362 B986 574E 8E04 10BD 6491 A52A CC5D AABC
To claim this, I am signing this object:
| // I am confused about how you can use `call` without supplying an object for `this` | |
| // The docs don't indicate that you can: | |
| // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call | |
| var funny = function (a) { return (a + 3); } | |
| funny(3); // 6 | |
| funny.call({},3); // 6 | |
| funny.call(3); // NaN // (as expected) | |
| var xs = [1,2,3] |
| ## | |
| # id must be the id attribute of the editor instance (without the #) e.g. | |
| # <textarea id="foo" ...></textarea> | |
| # would be filled in by calling | |
| # tinymce_fill_in 'foo', 'some stuff' | |
| # | |
| def tinymce_fill_in(id, val) | |
| # wait until the TinyMCE editor instance is ready. This is required for cases | |
| # where the editor is loaded via XHR. | |
| sleep 0.5 until page.evaluate_script("tinyMCE.get('#{id}') !== null") |
I hereby claim:
To claim this, I am signing this object:
| newpg=9.3.2 | |
| oldpg=9.2.4 # set this to your current PG version | |
| # Stop current Postgres server | |
| launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist | |
| # Backup current db | |
| mv /usr/local/var/postgres/ /usr/local/var/postgres-$oldpg | |
| # Homebrew |
| #!/bin/bash | |
| # This script can be used in "run & hope" mode or you can use it as a recipe to | |
| # do things manually - you probably want the latter if you really care about | |
| # the data in your databases. | |
| # Happy hacking | |
| # /Eoin/ | |
| # Tell bash to stop if something goes wrong | |
| set -e |
| ## | |
| # | |
| class Connection | |
| def self.create_many(inits) | |
| inits.map { |init| new(init) } | |
| end | |
| def self.for_all(conns, &block) | |
| block.call(conns) | |
| end |
| #!/usr/bin/env ruby | |
| require "net/http" | |
| require "json" | |
| CODESHIP_API_KEY = "PUT_YOUR_CODESHIP_API_KEY_HERE".freeze | |
| origin_remote_url = `git config --get remote.$(git config --get branch.master.remote).url`.chomp | |
| current_project_name = %r{(?:\:|\/)(.+)\.git$}.match(origin_remote_url)[1] | |
| current_branch_name = `git rev-parse --abbrev-ref HEAD`.chomp |
| #!/usr/bin/env ruby | |
| require "nokogiri" | |
| require "net/http" | |
| courtenay_place = 5002 # Get your stop number from the metlink.co.nz website | |
| buses_i_care_about = %w(52 56 57 58) | |
| # .../departures returns 20 results |
Good blog post on promises: https://developers.google.com/web/fundamentals/getting-started/primers/promises
Why promises