Skip to content

Instantly share code, notes, and snippets.

View jabbalaci's full-sized avatar

Laszlo Szathmary jabbalaci

View GitHub Profile
@jabbalaci
jabbalaci / face_detect.py
Created May 11, 2011 03:28
Face Detection in Static Images with Python
#!/usr/bin/env python
"""
Origin: http://creatingwithcode.com/howto/face-detection-in-static-images-with-python/
Patched for Ubuntu 11.04 (the location of the XML file is different).
Installation:
sudo apt-get install python-opencv libcv-dev opencv-doc
"""
@jabbalaci
jabbalaci / mousepos_gui.py
Created August 14, 2011 08:34
Monitor mouse coordinates in real-time
#!/usr/bin/env python
"""
Not good, the thread doesn't stop...
"""
import sys
import atexit
from time import sleep
@jabbalaci
jabbalaci / get_page_with_cookiejar.py
Created September 12, 2011 02:33
download a cookie-protected page using cookielib
#!/usr/bin/env python
import os
import sqlite3
import cookielib
import urllib2
COOKIE_DB = "{home}/.mozilla/firefox/cookies.sqlite".format(home=os.path.expanduser('~'))
CONTENTS = "host, path, isSecure, expiry, name, value"
COOKIEFILE = 'cookies.lwp' # the path and filename that you want to use to save your cookies in
@jabbalaci
jabbalaci / ghpp.py
Created May 17, 2012 06:30
Random Python projects from GitHub.
#!/usr/bin/python
"""
Random Python projects from GitHub.
The first one is a popular one from the Top 100.
The second one is from the rest.
"""
import random
@jabbalaci
jabbalaci / hurdles.py
Created August 10, 2012 22:52
Play Hurdles 2012 (google doodle)
#!/usr/bin/env python
"""
Play http://www.google.com/doodles/hurdles-2012 .
Code based on https://gist.github.com/3287367 .
"""
import time
from autopy import key
@jabbalaci
jabbalaci / alice.py
Created December 18, 2012 17:43
Alice chat bot
#!/usr/bin/env python
import requests
from bs4 import BeautifulSoup
import termcolor
BOT_URL = 'http://www.pandorabots.com/pandora/talk?botid=a847934aae3456cb'
def main():
@jabbalaci
jabbalaci / pycon2012-downloader.py
Last active May 18, 2018 22:20
Download PyCon US 2012 videos in a multithreaded way.
#!/usr/bin/env python
"""
Download PyCon US 2012 videos in a multithreaded way.
Requirement: youtube-dl script.
written by Jabba Laci, 2013 (jabba.laci@gmail.com)
http://pythonadventures.wordpress.com/
PyCon US 2012 videos: http://pyvideo.org/category/17
@jabbalaci
jabbalaci / szilvasbukta.py
Created January 3, 2014 12:23
image extractor for szilvasbukta.com posts without liking it
#!/usr/bin/env python
# encoding: utf-8
"""
Facebook is recently full of szilvasbukta.com links. However, if
you want to see an image, you must like it. WTF? This script extracts
the hidden image and opens it in your browser (in Firefox, by default).
dropped together by Jabba Laci (jabba.laci@gmail.com)
"""
@jabbalaci
jabbalaci / wallpapers
Created April 6, 2014 17:32
38,157 wallpapers on Imgur
xBVcONf.jpg
lCOiFrN.jpg
QbFUTKA.jpg
v47ZH4i.jpg
86mqrYV.jpg
Cvk8T.jpg
FMJmGz4.jpg
lsyYPhu.jpg
Whoctyt.jpg
j28ALSI.jpg
@jabbalaci
jabbalaci / firefox.py
Created January 5, 2015 11:23
open tabs with Firefox in the background (as requested in http://redd.it/2rd2g9)
#!/usr/bin/env python2
"""
Automate your browser via telnet.
Requirements:
* Firefox
* MozRepl add-on (https://addons.mozilla.org/en-US/firefox/addon/mozrepl/)
- activate the add-on (under Tools -> MozRepl, "Start" and "Activate on startup")
Documentation of gBrowser: