Skip to content

Instantly share code, notes, and snippets.

View thesnapdragon's full-sized avatar

Milán Unicsovics thesnapdragon

View GitHub Profile
@thesnapdragon
thesnapdragon / trip_service.py
Last active April 16, 2023 18:49
Trip Service Kata
#!/usr/bin/env python
class UserNotLoggedInException(Exception):
pass
class Trip:
pass
@thesnapdragon
thesnapdragon / physicist_hostname.py
Last active December 13, 2015 13:24
Generate hostname named after famous physicists
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Milán Unicsovics, u.milan at gmail dot com
# usage: physicist_hostname.py [-h] [-q]
# optional arguments:
# -h, --help show this help message and exit
# -q, --quiet suppress output verbosity
# generates a hostname
#!/bin/bash
# script for pyenv installation of pygtk3 in ubuntu 12.04
# Adapted from https://gist.github.com/mehcode/6172694
system_package_installed() {
if ! dpkg -l | grep -q $1; then
sudo apt-get install $1
fi
}
@thesnapdragon
thesnapdragon / gmailToConky.py
Last active August 29, 2015 13:55
little Python script that writes out the count of unread gmails
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Milán Unicsovics, u.milan at gmail dot com
# usage: ./gmailToConky.py
# writes out the count of unread gmails
import requests
from xml.dom.minidom import parseString
@thesnapdragon
thesnapdragon / rssToConky_old.py
Created January 30, 2014 22:54
old Python script that fetched Google Reader unread feeds count
#!/usr/bin/env python
import urllib
import urllib2
import xml.etree.ElementTree as ET
def main():
username = 'EMAILADDRESS'
password = 'PASSWORD'
@thesnapdragon
thesnapdragon / calToConky.py
Created January 30, 2014 22:48
little script with Google Calendar API for Conky
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Milán Unicsovics, u.milan at gmail dot com
# usage: ./calToConky.py
# writes out upcoming calendar events from Google Calendar
import gdata.calendar.service
import datetime
from textwrap import fill
@thesnapdragon
thesnapdragon / SicstusProlog.sublime-snippet
Last active December 24, 2015 15:49
Sublime entry point snippet for Prolog language
<snippet>
<content><![CDATA[
main:-
findall(${2:ReturnValue}, ${1:function(ReturnValue)}, L), write(L), nl.
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>main</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.prolog</scope>
</snippet>
@thesnapdragon
thesnapdragon / SicstusProlog.sublime-build
Last active December 24, 2015 15:49
Sublime build system for SICStus Prolog
{
"cmd": ["prolog", "-l", "$file_name", "--goal", "main.", "--noinfo", "--nologo"],
"working_dir": "$file_path",
"selector": "source.prolog"
}
@thesnapdragon
thesnapdragon / rssToConky.py
Last active December 17, 2015 12:19
little Python script to get count of unread RSS feeds from The Old Reader
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Milán Unicsovics, u.milan at gmail dot com
# usage: ./rssToConky.py
# writes out the count of unread RSS feeds from The Old Reader (http://theoldreader.com/)
import requests
import json
@thesnapdragon
thesnapdragon / processPost.sh
Last active December 14, 2015 05:09
Shell script for processing Blogspot .html posts commandline generated with UberWriter. Image upload, justify and another features.
#!/bin/bash
# Milán Unicsovics, u.milan at gmail dot com
# usage: ./processPost.sh <postname>.html
# required: googlecl (http://code.google.com/p/googlecl/)
post=$1
imgdir=<RESOURCE DIRECTORY>
blogname="<BLOGNAME>"