cpt | L | L | L | L | | | | | | | | |
naito | L | L | L | W | | | | | | | | |
rattao | L | W | L | L | | | | | | | | |
gui | L | W | W | W | | | | | | | | |
distro | W | L | W | L | | | | | | | | |
pelf | L | W | W | W | | | | | | | | |
cioga | L | W | L | L | | | | | | | | |
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
import sublime, sublime_plugin, random, string, re | |
class AnonymiseCommand(sublime_plugin.TextCommand): | |
def replacement(self, s): | |
# Figure out which chars to use | |
chars = [] | |
if re.search("[a-z]", s): | |
chars += string.ascii_lowercase | |
if re.search("[A-Z]", s): |
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
# When given an array with a single duplicate number, | |
# it returns that number. | |
def find_duplicate_number(arr) | |
arr | |
end | |
puts '# find_duplicate_number:' | |
puts find_duplicate_number([5,3,7,2,3,1]) == 3 | |
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/sh | |
echo "🌀 Checking for focus: true..." | |
# Check for focus in spec files | |
grep -r --include \*_spec.rb "focus:" spec || grep -r --include \*_spec.rb ":focus" spec | |
if [[ $? == 0 ]] | |
then | |
echo >&2 "❌ Found focus in spec file, not pushing" |
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
puts (1...1000).inject(0) {|sum,i| | |
sum = (sum + i) if i%5 == 0 or i%3 == 0 | |
sum | |
} |
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
# radius: exact nr meters | |
# slabs: 1x1m | |
# cut 1/3 of slabs | |
# total nr slabs? | |
# ---- | |
MAX_SLABS_RADIUS = 100 | |
# check only a quarter of the circle, the rest is simetric | |
# try different radiuses |
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
require 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
class Brickset | |
@@db = nil # database / cache | |
class Set | |
attr_accessor :id, :year, :pieces, :rrpp, :rrpd, :rating, :theme, :subtheme | |
def initialize(id) |
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
require 'rubygems' | |
require 'util' | |
module Lastfm | |
class Artist | |
attr_accessor :name | |
def initialize(name) | |
@name = 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
require 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
class Amazon | |
class Book | |
attr_accessor :title, :author, :amazon_id, :img | |
def initialize(url) | |
url =~ /\/(\d+)\// |
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
<!DOCTYPE html> | |
<head> | |
<title>Snow</title> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"></script> | |
<script src="snow.js" type="text/javascript"/></script> | |
</head> | |
<body onload="init();"> | |
<canvas id="bgcanvas" width="410" height="316" style="position:absolute;z-index:2"></canvas> | |
<img src="globe_layers_2.png" style="position:absolute;z-index:3"> | |
<canvas id="fgcanvas" width="410" height="316" style="position:absolute;z-index:4"></canvas> |