Skip to content

Instantly share code, notes, and snippets.

@lstejskal
lstejskal / kohoutovicka_anketa.csv
Created February 2, 2013 12:10
Průběžné stavy hlasování v kohoutovické anketě o stavbě hotelu v lednu 2013 EN: Log of votes in Kohoutovice poll on the construction of the hotel in January 2013
01.01 00:00 51 191 37 3
01.01 01:00 51 191 37 3
01.01 02:00 51 191 37 3
01.01 03:00 51 191 37 3
01.01 04:00 51 191 37 3
01.01 05:00 51 191 37 3
01.01 06:00 51 191 37 3
01.01 07:00 51 191 37 3
01.01 08:00 51 191 37 3
01.01 09:00 51 191 37 3
@lstejskal
lstejskal / kohopoll_archive.txt
Created February 2, 2013 11:57
Complete archive of tweets from @kohopoll
[01.02.2013 09:30:02] ano: 25% (492), ano_ale: 4% (85), ne: 69% (1338), nevim: 0% (15)
[01.02.2013 09:15:01] ano: 25% (492), ano_ale: 4% (85), ne: 69% (1338), nevim: 0% (15)
[01.02.2013 09:00:06] ano: 25% (492), ano_ale: 4% (85), ne: 69% (1338), nevim: 0% (15)
[01.02.2013 08:45:02] ano: 25% (492), ano_ale: 4% (85), ne: 69% (1338), nevim: 0% (15)
[01.02.2013 08:30:01] ano: 25% (492), ano_ale: 4% (85), ne: 69% (1338), nevim: 0% (15)
[01.02.2013 08:15:01] ano: 25% (492), ano_ale: 4% (85), ne: 69% (1338), nevim: 0% (15)
[01.02.2013 08:00:01] ano: 25% (492), ano_ale: 4% (85), ne: 69% (1338), nevim: 0% (15)
[01.02.2013 07:45:01] ano: 25% (492), ano_ale: 4% (85), ne: 69% (1338), nevim: 0% (15)
[01.02.2013 07:30:02] ano: 25% (492), ano_ale: 4% (85), ne: 69% (1338), nevim: 0% (15)
[01.02.2013 07:15:02] ano: 25% (492), ano_ale: 4% (85), ne: 69% (1338), nevim: 0% (15)
@lstejskal
lstejskal / poll_scraper.rb
Created February 2, 2013 11:26
Poll scraper - scrapes poll results from website and publishes them on Twitter. PS: extracted from production, might require some tuning
require 'rubygems'
require 'open-uri'
require 'nokogiri'
require 'twitter'
class Kohoutovice
def self.scrape_poll_results
website = 'http://www.kohoutovice.cz/modules/xoopspoll/pollresults.php?poll_id=29'
@lstejskal
lstejskal / array_sequence.py
Created September 9, 2012 20:08
Detecting sequence in array
# How to detect sequence in an array
def is_sequence(arr):
"Return True if the array is sequence."
return (len(set(arr)) == len(arr)) and ((max(arr) - min(arr)) == (len(arr) - 1))
def test():
"Test cases for the functions in poker program."
"Test cases for the Array.sequence method."
@lstejskal
lstejskal / player.rb
Created May 13, 2012 21:15
rubywarrior player script - intermediate level
class Player
DIRECTIONS = [ :forward, :backward, :left, :right ]
# this logs your path through the level
# PS: we might need this in order to return to safety when injured
PATH = []
MIN_HEALTH = 18
CRITICAL_HEALTH = 10