View es_data_test.rb
require 'open-uri'
require 'json'
require 'net/http'
# EventsIndex.purge!
# EventsIndex.reset!
# Event.create!(
# occured_at: Time.now - 1.day,
# original_payload: {
View lock.rb
with_exclusive_lock("my_operation") do
# Something that can only happen one at a time
end
def with_exclusive_lock(lock_name, &block)
lock_file_name = "/tmp/#{lock_name}.lock"
FileUtils.touch(lock_file_name)
lock_file = File.new(lock_file_name)
lock_file.flock(File::LOCK_EX)
yield
View gist:9e127cdf455694aa48b26a0528981877
Ubuntu:
root@willtesting:/var/log# openssl ciphers -v | grep TLS
ECDHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH Au=RSA Enc=AESGCM(256) Mac=AEAD
ECDHE-ECDSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH Au=ECDSA Enc=AESGCM(256) Mac=AEAD
ECDHE-RSA-AES256-SHA384 TLSv1.2 Kx=ECDH Au=RSA Enc=AES(256) Mac=SHA384
ECDHE-ECDSA-AES256-SHA384 TLSv1.2 Kx=ECDH Au=ECDSA Enc=AES(256) Mac=SHA384
DHE-DSS-AES256-GCM-SHA384 TLSv1.2 Kx=DH Au=DSS Enc=AESGCM(256) Mac=AEAD
DHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=DH Au=RSA Enc=AESGCM(256) Mac=AEAD
DHE-RSA-AES256-SHA256 TLSv1.2 Kx=DH Au=RSA Enc=AES(256) Mac=SHA256
View start.go
package main
import "fmt"
func main() {
fmt.Println("Hello world!")
}
View Mushroom lunch.md

Simple fried mushroom spaghetti

A fast and easy dish, great for lunch, takes about 10-15 minutes, basically as long as it takes you to boil the water and cook the spaghetti, the rest of the prep can be done while the pasta is cooking.

Ingredients

  • 100g fancy mushrooms. I buy these from Sainsburys (makes two servings)
  • 4 or 5 regular button mushrooms
  • 1 clove garlic
  • Salt
View gist:0f5e144cc531036ac877
(master) tomato:railties will$ ruby -Itest:lib:/home/travis/build/rails/rails/railties/../activesupport/lib:/home/travis/build/rails/rails/railties/../actionpack/lib:/home/travis/build/rails/rails/railties/../activemodel/lib test/application/initializers/i18n_test.rb
Run options: --seed 25630
# Running:
.F.......FF......
Finished in 68.520628s, 0.2481 runs/s, 0.3794 assertions/s.
1) Failure:
View gist:fb61b2c3dad204bc9b6b
Ruby compiled with:
'optflags=-O0' 'debugflags=-g3 -ggdb' 'CFLAGS=-O0 -g3 -ggdb'
Confirmed with:
ruby -e 'puts RbConfig::CONFIG["CFLAGS"]'
GDB output shows it reading symbold from Rub, but setting a breakpoint GDB can't find the symbol requested and ultimately never breaks:
View BOO!
open("/tmp/cache/NormalizationTest.txt", O_RDONLY|O_CLOEXEC) = 7
ioctl(7, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, 0x7fffffffa238) = -1 ENOTTY (Inappropriate ioctl for device)
read(7, "# NormalizationTest-8.0.0.txt\n# "..., 8192) = 8192
close(7) = 0
close(7) = -1 EBADF (Bad file descriptor)
read(7, 0x3ba0800, 8192) = -1 EBADF (Bad file descriptor)
close(7) = -1 EBADF (Bad file descriptor)
write(1, "E", 1) =
View gist:5a17ecfab0f31bd88989
(master) tomato:activesupport will$ bundle exec rake test
/Users/will/.rbenv/versions/2.2.0/bin/ruby -w -I"lib:test" -I"/Users/will/.rbenv/versions/2.2.0/lib/ruby/2.2.0" "/Users/will/.rbenv/versions/2.2.0/lib/ruby/2.2.0/rake/rake_test_loader.rb" "test/**/*_test.rb"
I, [2015-11-23T17:40:58.881735 #79250] INFO -- : localhost:11211 failed (count: 0) Errno::ECONNREFUSED: Connection refused - connect(2) for "localhost" port 11211
Skipping memcached tests. Start memcached and try again.
Run options: --seed 45561
# Running:
...........................................................................................................................................................SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS....................................................................................................................................................................................
View Shift_buddies.txt
Ordered by most shift buddies:
BU has 14 shift buddies: EX, HA, OH, PI, UN, YR, AT, EX, HA, OH, PI, UN, YR, AT
PO has 14 shift buddies: UT, VU, BA, ED, FE, JI, ON, UT, VU, BA, ED, FE, JI, ON
OD has 12 shift buddies: SH, TI, YN, ZO, FU, LA, SH, TI, YN, ZO, FU, LA
TI has 12 shift buddies: YN, ZO, FU, LA, OD, SH, YN, ZO, FU, LA, OD, SH
AL has 12 shift buddies: DO, IT, JU, PA, TE, XI, DO, IT, JU, PA, TE, XI
EM has 12 shift buddies: GO, MU, OW, SA, WE, AI, GO, MU, OW, SA, WE, AI
NO has 12 shift buddies: ST, TU, ZA, AB, DE, HI, ST, TU, ZA, AB, DE, HI
ROB has 10 shift buddies: URE, DAN, HER, KHU, LIV, URE, DAN, HER, KHU, LIV