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 ruby | |
# frozen_string_literal: true | |
# Ruby GIL test | |
# Ideally this should saturate two cores. | |
a = [] | |
b = [] | |
t1 = Thread.new do |
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 python | |
import contextlib | |
import datetime | |
import os | |
import shutil | |
import smtplib | |
import subprocess | |
import tarfile | |
import tempfile |
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
scala> foo1 | |
finally | |
res0: String = foo | |
scala> foo2 | |
finally | |
after | |
res1: String = foo |
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
▶ brew list -1 | while read line; do brew unlink $line; brew link $line; done | |
Unlinking /usr/local/Cellar/appledoc/2.2... 0 links removed | |
Linking /usr/local/Cellar/appledoc/2.2... 1 symlinks created | |
Unlinking /usr/local/Cellar/autoconf/2.69... 0 links removed | |
Linking /usr/local/Cellar/autoconf/2.69... 18 symlinks created | |
Unlinking /usr/local/Cellar/bash-completion/1.3... 184 links removed | |
Linking /usr/local/Cellar/bash-completion/1.3... 182 symlinks created | |
Unlinking /usr/local/Cellar/bgrep/0.2... 0 links removed | |
Linking /usr/local/Cellar/bgrep/0.2... 1 symlinks created | |
Unlinking /usr/local/Cellar/binutils/2.24... 49 links removed |
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 Player | |
def max_health; 20; end; | |
def healing_threshold; 10; end | |
def initialize | |
@healing = false | |
@retreating = false | |
@last_action = nil |
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
<?php | |
# vim: sw=2 ts=2 | |
echo 'PHP version: ' . phpversion() . PHP_EOL; | |
function lookup_ake(array $a, $key, $default = null) | |
{ | |
if (array_key_exists($key, $a)) | |
{ | |
return $a[$key]; |
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
# Description: | |
# Last asks Hubot to repeat the last command he received | |
# | |
# Commands: | |
# hubot !! - execute the last received command | |
# hubot last - execute the last received command | |
# hubot repeat - execute the last received command | |
Robot = require('hubot') |
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 ruby | |
POPSIZE = 2048 | |
MAXITER = 16384 | |
ELITRATE = 0.10 | |
MUTATIONRATE = 0.25 | |
TARGET = "Hello world!" | |
class Ga | |
attr_accessor :str, :fitness |
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
def fun | |
begin | |
return "begin" | |
ensure | |
return "ensure" | |
end | |
end | |
puts "fun returned: '#{fun}'" |