Since I didn't have any slides during the talk, here are some resources that cover similar topics and/or were mentioned during the talk itself.
Happy hacking!
The article that inspired the talk: The Startup Trap.
#!/bin/bash | |
set -e | |
INSTALLED_CHROME_VERSION=$(apt-cache policy google-chrome-stable | grep Installed | egrep -o '[[:digit:]]+' | head -n1) | |
CHROMEDRIVER_VERSION=$(curl https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$INSTALLED_CHROME_VERSION) | |
# Download ChromeDriver into Semaphore's cached directory if it doesn't exist already | |
if ! [ -e $SEMAPHORE_CACHE_DIR/chromedriver-$CHROMEDRIVER_VERSION ]; then | |
mkdir -p $SEMAPHORE_CACHE_DIR/chromedriver-$CHROMEDRIVER_VERSION |
<?xml version="1.0" encoding="UTF-8"?> | |
<testsuite name="rspec" tests="9" failures="6" errors="0" time="0.001972" timestamp="2017-06-13T18:46:48+09:00"> | |
<properties> | |
<property name="seed" value="12345"/> | |
</properties> | |
<testcase classname="spec.example_spec" name="some example specs should be pending" file="./spec/example_spec.rb" time="0.000106"><skipped/></testcase> | |
<testcase classname="spec.example_spec" name="some example specs escapes <html tags='correctly' and="such &amp; such">" file="./spec/example_spec.rb" time="0.000458"><failure message=" | |
expected: "<p>This is <strong>very</strong> important</p>" | |
got: "<p>This is important</p>" |
#!/usr/bin/env ruby | |
require 'benchmark' | |
def add_methods_to_a_module(m) | |
1_000.times.map do |i| | |
method_name = "method_#{i}" | |
m.__send__(:define_method, method_name) {} | |
method_name | |
end |
Since I didn't have any slides during the talk, here are some resources that cover similar topics and/or were mentioned during the talk itself.
Happy hacking!
The article that inspired the talk: The Startup Trap.
Mac | |
3N6EAJLH649N | |
M7RM3HYF9HLE | |
KK4TN46LEAPF | |
NKP6K4YFEWTN | |
6NK9L3W3R9M9 | |
E3HW464L77WR | |
RHY9XXNRL793 | |
HWNF6RPXTPY9 | |
W7M373W7KXP7 |
;(function ($) { | |
var $elementsToCatchUp = $(), | |
followBased = false, | |
bound = false; | |
function startCatchingUp($catchup) { | |
$catchup | |
.before($('<div>', | |
{ 'class': 'catching-up-placeholder', 'height': $catchup.outerHeight() })) | |
.addClass('catching-up') |
# Strip leading and trailing bytes | |
def self.decode data, &blk | |
while msg = data.slice!(/\000([^\377]*)\377/) | |
msg.gsub!(/^\x00|\xff$/, '') | |
yield msg | |
end | |
end |
// approach one: simply assign function to prototype | |
// it works, but you still need to use "apply" to make the method | |
// work as needed | |
function smallest1(array){ | |
Array.prototype.min = Math.min; | |
return array.min.apply(array, array); | |
} | |
// approach two: use apply in the function assigned to Array's prototype | |
function smallest2(array){ |
(function($) { | |
function print_array(obj, opts) { | |
var result = []; | |
for (var i = 0; i < Math.min(opts.max_array, obj.length); i++) | |
result.push($.print(obj[i], $.extend({}, opts, { max_array: 3, max_string: 40 }))); | |
if (obj.length > opts.max_array) | |
result.push((obj.length - opts.max_array) + ' more...'); | |
if (result.length == 0) return "[]" |
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'osax' | |
require 'maruku' | |
doc = Appscript.app('WriteRoom').documents[0] | |
path = doc.file.get.path | |
file = File.join( |