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
#!/usr/bin/env bash | |
export AWS_PROFILE=<snip> | |
ImageDescription="Amazon Linux AMI 2017.09.1.20180115" | |
RegionNames=$(aws ec2 describe-regions --region eu-west-1 --query 'Regions[*].[RegionName]' --output text) | |
function getImages () { | |
region=$1 | |
filters="[ |
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
defp prepare_signed_url({region, bucket, object}, friendly_name) do | |
config = ExAws.Config.new(:s3, %{region: region}) | |
encoded_name = URI.encode(friendly_name, fn | |
x when ?0 <= x <= ?9 -> true | |
x when ?A <= x <= ?Z -> true | |
x when ?a <= x <= ?z -> true | |
_ -> false | |
end) | |
options = [ |
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
class Wxmac < Formula | |
desc "Cross-platform C++ GUI toolkit (wxWidgets for macOS)" | |
homepage "https://www.wxwidgets.org" | |
url "https://github.com/wxWidgets/wxWidgets/releases/download/v3.0.3.1/wxWidgets-3.0.3.1.tar.bz2" | |
sha256 "3164ad6bc5f61c48d2185b39065ddbe44283eb834a5f62beb13f1d0923e366e4" | |
head "https://github.com/wxWidgets/wxWidgets.git" | |
bottle do | |
cellar :any | |
sha256 "9766307eb821a254c81002e7318aa89dc2f4cd7a5a09515fce54eb96ae70f898" => :sierra |
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
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 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 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 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
.siFancyScrollbar { | |
::-webkit-scrollbar, | |
::-webkit-scrollbar-button:start:increment, | |
::-webkit-scrollbar-button:start:decrement, | |
::-webkit-scrollbar-button:end:increment, | |
::-webkit-scrollbar-button:end:decrement { | |
width: 9px; | |
height: 9px; |
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
CTFontManagerRegisterFontsForURLs((__bridge CFArrayRef)((^{ | |
NSFileManager *fileManager = [NSFileManager defaultManager]; | |
NSURL *resourceURL = [[NSBundle mainBundle] resourceURL]; | |
NSArray *resourceURLs = [fileManager contentsOfDirectoryAtURL:resourceURL includingPropertiesForKeys:nil options:0 error:nil]; | |
return [resourceURLs filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(NSURL *url, NSDictionary *bindings) { | |
CFStringRef pathExtension = (__bridge CFStringRef)[url pathExtension]; | |
NSArray *allIdentifiers = (__bridge_transfer NSArray *)UTTypeCreateAllIdentifiersForTag(kUTTagClassFilenameExtension, pathExtension, CFSTR("public.font")); | |
if (![allIdentifiers count]) { | |
return NO; | |
} |
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
@implementation RAEditorView | |
- (instancetype) initWithCoder:(NSCoder *)aDecoder { | |
self = [super initWithCoder:aDecoder]; | |
if (self) { | |
[self setup]; | |
} | |
return self; | |
} |
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
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, |