Skip to content

Instantly share code, notes, and snippets.

View anroots's full-sized avatar

Ando David Roots anroots

View GitHub Profile
@anroots
anroots / Python script check that a list of sites return HTTP 200
Created January 6, 2012 11:32
Python script settings file: check that a list of sites return HTTP 200
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This script check a list of websites
# and sends mail when the HTTP status code is not 200
#
# Used to check wheter all projects are up and running
# (not broken, say for example because a dependency library was removed)
# Author Ando Roots 2012
@anroots
anroots / ITKGrades.rb
Created February 29, 2012 22:03
A ruby class that returns a Hash of ITK (itcollege.ee) student's grades.
#!/usr/bin/env ruby
# Estonian IT College grade sheet scraper
# A dirty version for just getting the job done.
# Maybe prettify in the future.
#
# Version 1.1
# Author "Ando Roots" <anroots@itcollege.ee>
# Created 29.02.2012
# Licence Apache v2 http://www.apache.org/licenses/LICENSE-2.0.html
@anroots
anroots / plugins.js
Created May 7, 2012 08:54
Custom Tablesorter parser for Estonian date formats (dd.mm.YYYY)
// Custom date format parser for Estonian for the Tablesorter(.com) jQuery plugin
$.tablesorter.addParser({
id:'estDate',
is:function (s) {
return /\d{1,2}[\/\-\.]\d{1,2}[\/\-\.]\d{2,4}/.test(s);
},
format:function (s, table) {
var c = table.config;
s = s.replace(/\-/g, '/');
@anroots
anroots / skype_sms.py
Created May 11, 2012 01:10
Send SMS via Skype
# Saadab Skypelt SMS-i telefonile ning kirjutab teate sisu logifaili
# Ando Roots 2009
import sys
import Skype4Py
#Argumendid
if (len(sys.argv) > 2):
number = sys.argv[1]
teade = sys.argv[2]
@anroots
anroots / fetch_info.py
Created May 11, 2012 01:15
A script to get specified info from a URL
#!/usr/bin/python -tt
# A script to get specified info from a URL
# Author Ando Roots 2010
# Usage: Specify the parameters with command line options.
# Usage: ./fetch_info.py URL Search_pattern_start Search_pattern_end
# EXAMPLE: Rate.ee number of online users
# ./fetch_info.py http://www.rate.ee/ 'amp;act=search"&gt;<strong>' ' &amp;raquo;</strong>'
import sys
@anroots
anroots / 43_tips.py
Created May 11, 2012 01:17
A script to display a random goal from 43things.com in Ubuntu's Notify-OSD. Set it up to start on login and you'll get a new goal every day.
#!/usr/bin/python -tt
# A script to display a random goal from 43things.com in Ubuntu's Notify-OSD. Set it up to start
# on login and you'll get a new goal every day.
# Author: A. Roots
import urllib, sys
from xml.dom import minidom
import random
import pynotify
@anroots
anroots / chatty.py
Created May 11, 2012 01:20
Have a conversation with a PandaBot AI
#!/usr/bin/python -tt
# Have a conversation with a PandaBot AI
# Author A.Roots
import urllib, urllib2
import sys
from xml.dom import minidom
from xml.sax.saxutils import unescape
@anroots
anroots / eki.py
Created May 11, 2012 01:24
Poomismängu- ja ristsõnalahendaja, asutab EKI andmebaasi
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Poomismängu- ja ristsõnalahendaja
# Kasutab EKI andmebaasi
# Märge tulevikuks: ära kasuta re-d html-i töötlemiseks! BeautifulSoup!
# A. Roots 2010
import urllib, re, sys
@anroots
anroots / Beverage.java
Created May 11, 2012 01:40
An Applet that gives advice on which beverage to drink.
import java.applet.Applet;
import java.awt.*;
/**
* An Applet that gives advice on which beverage to drink.
* @author Ando Roots & Carolys K.
*/
public class Beverage extends Applet {
/**
@anroots
anroots / insult.py
Created May 11, 2012 01:42
This program chooses a random line from solvangud.txt and sends it as a reply to Pidgin
# -*- coding: utf-8 -*-
# This program chooses a random line from solvangud.txt and sends it as a reply to Pidgin
# Author: Ando Roots
from random import choice
import difflib
import sys
import dbus, gobject
from dbus.mainloop.glib import DBusGMainLoop
import re