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 Node | |
def distance_to cluster | |
self.reduce(nil) do |min, i| | |
cluster.reduce(min) do |min, j| | |
d = i.distance_to j | |
min = if min.nil? or min > d then d else min end | |
end | |
end | |
end | |
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
Sub RepeatExperiment() | |
' | |
' RepeatExperiment Macro | |
' | |
' | |
For i=0 To 40 | |
Sheets("Simulación").Select | |
Sheets("Simulación").Copy After:=Sheets(Sheets.Count) | |
Range("B2").Select |
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 respond_to? method_sym, include_private = false | |
if @a.has_key? method_sym | |
true | |
else | |
super method_sym, include_private | |
end | |
end | |
def method_missing method_sym, *arguments, &block | |
if @a.has_key? method_sym |
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
workspaceparent="$HOME" | |
cd $workspaceparent | |
mkdir cortoproject | |
cd cortoproject | |
git clone https://github.com/cortoproject/corto | |
git clone https://github.com/cortoproject/c-binding | |
git clone https://github.com/cortoproject/xml | |
git clone https://github.com/cortoproject/corto-language | |
git clone https://github.com/cortoproject/io |
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
# I use this script in cloud9 | |
/usr/bin/python3 -m venv --without-pip env | |
source env/bin/activate | |
curl https://bootstrap.pypa.io/get-pip.py | python | |
deactivate | |
source env/bin/activate |
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
workspaceparent="$HOME" | |
# needs to be run after cortobootstrap.sh | |
cd "$workspaceparent/cortoproject" | |
git clone https://github.com/cortoproject/python-binding | |
cd python-binding | |
# virtual environment | |
python3 -m venv --without-pip env | |
source env/bin/activate | |
curl https://bootstrap.pypa.io/get-pip.py | python |
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
touch `date +"%Y.%m.%d.md"` |
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
# Rake Quick Reference | |
# by Greg Houston | |
# http://ghouston.blogspot.com/2008/07/rake-quick-reference.html | |
# ----------------------------------------------------------------------------- | |
# Running Rake | |
# ----------------------------------------------------------------------------- | |
# running rake from the command-line: | |
# rake --help |
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
default_template: | |
title: "Default" | |
settings: | |
"*": | |
"editor.tabLength": 4 | |
".source.coffee": | |
"editor.tabLength": 2 | |
".source.ruby": | |
"editor.tabLength": 2 | |
alfiebox: |
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
#!/bin/bash | |
# tip: run with `./hashes.sh | column -t` | |
set -eu | |
for g in `find . -name .git` | |
do | |
d=$(basename $(dirname $g)) | |
h=$(git --git-dir $g rev-parse HEAD) |