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
pallete = Array(String, 93) | |
i = 1 | |
for bg = 232:(255-1) | |
for char in [" ", "░", "▒", "▓"] | |
pallete[i] = "\e[38;5;$(bg+1)m\e[48;5;$(bg)m$(char)\e[0m" | |
i += 1 | |
end | |
end | |
pallete[93] = "\e[48;5;$(255)m \e[0m" |
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
# ccv_dense_matrix_t* image = 0 | |
image = Array(Ptr{Void},0) | |
# int ccv_read_impl(const void* in, ccv_dense_matrix_t** x, int type, int rows, int cols, int scanline); | |
r = ccall( | |
(:ccv_read_impl, "libccv"), | |
Int32, | |
(Ptr{Uint8}, Ptr{Ptr{Void}}, Int, Int, Int, Int), | |
"/home/vagrant/dev/julia/test.png", image, 0x100 | 0x020, 0, 0, 0) |
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 | |
// Instructions: save this file to the base diretory of the kumite-moa repo.. | |
require 'vendor/autoload.php'; | |
/** | |
* Calculates the statistical significance of a boolean experiment over | |
* multiple events (e.g. contests), where the result for each event is | |
* a true/false outcome (e.g. contest was or was not refunded). |
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 | |
use Symfony\Component\HttpFoundation\Request; | |
class KelpieSymfonyAdaptor | |
{ | |
public function __construct($app) | |
{ | |
$this->_app = $app; | |
} |
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 | |
require_once __DIR__.'/../vendor/autoload.php'; | |
require_once __DIR__.'/../lib/kelpie/lib/kelpie.php'; | |
require_once 'KelpieSymfonyAdaptor.php'; | |
$app = new Silex\Application(); | |
$app->get('/hello/{name}', function ($name) use ($app) { | |
return 'Hello '.$app->escape($name); | |
}); |
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 | |
function ($hello, $hello, $̀) { | |
echo "$hello$hello$̀\n"; | |
} | |
("lolol", "trolo", "!"); |
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 | |
function ($) { | |
echo "Hello $!\n"; | |
} | |
("world"); | |
function test($̀a) { echo $̀a; } | |
test("zomg!\n"); |
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 fib | |
f0, f1 = 0, 1 | |
loop do | |
f0, f1 = f1, (f0 + f1) | |
r = yield f1 | |
return if !r | |
end | |
end | |
fib do |n| |
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
# screen had it right, C-B is too hard to reach. | |
unbind C-b | |
set -g prefix ` | |
# set -g prefix ` | |
# http://blog.hawkhost.com/2010/06/28/tmux-the-terminal-multiplexer/ | |
unbind % | |
bind | split-window -h | |
bind - split-window -v |
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
# See: https://github.com/beoran/chipmunk/tree/master/spec | |
# + http://chipmunk-physics.net/release/ChipmunkLatest-Docs/ | |
require 'chipmunk' # gem install chipmunk | |
s = CP::Space.new | |
s.gravity = vec2(0,0) | |
b1 = CP::Body.new(5, 7) | |
b1.pos = vec2(400,600) | |
b1.v = vec2(30,1) |