- Josh Goebel (@yyyc514): suggested lazy evaluation on
set
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
Overlord:~ evadne$ brew install erlang | |
==> Installing dependencies for erlang: autoconf, automake, libtool, pkg-config, makedepend, openssl, jpeg, libpng, libtiff, wxmac | |
==> Installing erlang dependency: autoconf | |
==> Using the sandbox | |
==> Downloading https://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz | |
######################################################################## 100.0% | |
==> ./configure --prefix=/usr/local/Cellar/autoconf/2.69 --with-lispdir=/usr/local/Cellar/autoconf/2.69/share/emacs/site-lisp/autoconf | |
==> make install | |
==> Caveats | |
Emacs Lisp files have been installed to: |
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
defmodule Script do | |
def cosine_similarity(lhs, rhs) do | |
{ab, aa, bb} = accumulate(lhs, rhs) | |
ab / (:math.sqrt(aa) * :math.sqrt(bb)) | |
end | |
defp accumulate(lhs, rhs) do | |
accumulate(lhs, rhs, 0, 0, 0) | |
end | |
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
macOS 10.12.1 (Build 16B2659) | |
https://browser.geekbench.com/v4/compute/295179 | |
https://browser.geekbench.com/v4/compute/295180 | |
https://browser.geekbench.com/v4/compute/295182 | |
https://browser.geekbench.com/v4/compute/295185 | |
https://browser.geekbench.com/v4/compute/295187 | |
macOS 10.12.2 (Build 16C63a) | |
https://browser.geekbench.com/v4/compute/295151 | |
https://browser.geekbench.com/v4/compute/295161 |
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 EphemeralToken | |
attr_reader :origin, :targets, :expires_at, :payload | |
class TokenInvalid < StandardError; end | |
class TokenExpired < TokenInvalid; end | |
Algorithm = 'HS512' | |
Secret = ENV['SECRET_EPHEMERAL_TOKEN_KEY'] | |
ObjectToNotation = -> (target) { [target.class.model_name.name, target.id] } | |
NotationToObject = -> ((model_name, model_id)) { model_name.constantize.find_by_id(model_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
core@deis-1 ~ $ fleetctl journal -f [email protected] | |
-- Logs begin at Wed 2014-10-08 14:11:41 UTC. -- | |
Oct 10 15:03:08 deis-3 sh[30201]: [50cca74e] -job image_get(2f651070bd84650340ba1210ef10a8957c74c9dc32d39ff3bf4625cbc355ca1b) = ERR (1) | |
Oct 10 15:03:08 deis-3 sh[30201]: [50cca74e] +job image_get(fb8e2f5f8a6c25dcafe9d8a79ca35471a3a4251690581756fdad117046b199a4) | |
Oct 10 15:03:08 deis-3 sh[30201]: No such id: fb8e2f5f8a6c25dcafe9d8a79ca35471a3a4251690581756fdad117046b199a4 | |
Oct 10 15:03:08 deis-3 sh[30201]: [50cca74e] -job image_get(fb8e2f5f8a6c25dcafe9d8a79ca35471a3a4251690581756fdad117046b199a4) = ERR (1) | |
Oct 10 15:03:08 deis-3 sh[30201]: [50cca74e] +job image_get(4fc3518d6f3593906bb563241420abc018cfbfd705fe6528d3b22580bc625a49) | |
Oct 10 15:03:08 deis-3 sh[30201]: No such id: 4fc3518d6f3593906bb563241420abc018cfbfd705fe6528d3b22580bc625a49 | |
Oct 10 15:03:08 deis-3 sh[30201]: [50cca74e] -job image_get(4fc3518d6f3593906bb563241420abc018cfbfd705fe6528d3b22580bc625a49) = ERR (1) | |
Oct 10 15:03:08 deis-3 sh[30201]: |
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
# config/initializers/sidekiq.rb | |
require 'sidekiq' | |
Sidekiq.configure_client do |config| | |
config.redis = { | |
:url => ENV['SIDEKIQ_REDIS_URI'], | |
:namespace => ENV['SIDEKIQ_NAMESPACE'], | |
:size => ENV['SIDEKIQ_CLIENT_SIZE'] || 5 | |
} |
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
@implementation RAEditorView | |
- (instancetype) initWithCoder:(NSCoder *)aDecoder { | |
self = [super initWithCoder:aDecoder]; | |
if (self) { | |
[self setup]; | |
} | |
return self; | |
} |
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 something = function () { | |
alert("something destructive."); | |
} | |
((function(){ | |
alert("do it now. :D"); | |
})()); | |
// Function declaration for `something` is underhanded. | |
// It has no terminating semicolon, so the immediately evaluated expression, |
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
// Download all assets from https://developer.apple.com/wwdc/videos | |
// Warning: might take up a lot of disk space | |
NodeList.prototype.toArray = function () { | |
return Array.prototype.slice.call(this); | |
}; | |
[].concat.apply([], document.querySelectorAll("li.session").toArray().map(function(session){ | |
var sessionID = session.id.match(/^\d+/)[0]; | |
var title = session.querySelector(".title").innerText; |