This file contains hidden or 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
prel -e 'use JSON; | |
use LWP::Simple; | |
my $data = get "https://api.github.com/users/damianzaremba/repos"; | |
my $json = decode_json($data); | |
print "Found: "; | |
my $count=0; | |
for(@$json) { print $_->{"name"} . ","; $count++; }; | |
print " (" . $count . ") repos\n";' | |
Found: ClueNet, Bordness, damianzaremba.github.com, api-scripts, Me, |
This file contains hidden or 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
#!/usr/bin/python | |
import urllib2 | |
import urllib | |
import cookielib | |
from BeautifulSoup import BeautifulSoup | |
try: | |
from simplejson import json | |
except ImportError: | |
import json |
This file contains hidden or 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
#!/usr/bin/perl | |
use strict; | |
use Mail::IMAPClient; | |
use IO::Socket; | |
use IO::Socket::SSL; | |
use Time::ParseDate; | |
use Data::Dumper; | |
# Config stuff | |
my $mail_hostname = ''; |
This file contains hidden or 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
<?php | |
/* | |
Plugin Name: LastFM | |
Plugin URI: | |
Description: Displays data from LastFM | |
Author: damianzaremba | |
Author URI: http://damianzaremba.co.uk | |
Version: 1.0 | |
License: GPL3 | |
*/ |
This file contains hidden or 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
DamiansMacBookPro:patchwork damian$ python | |
clPython 2.6.1 (r261:67515, Jun 24 2010, 21:47:49) | |
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> class Boob(object): | |
... someawesomething = "nipple" | |
... | |
>>> abc = Boob() | |
>>> print(abc.someawesomething) | |
nipple |
This file contains hidden or 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
root@localhost [/]# date -d@1290705757 +"%H:%M:%S %d/%m/%Y" | |
18:22:37 25/11/2010 |
This file contains hidden or 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/bash | |
pod2pdf --noheader damianzaremba.man > damianzaremba.pdf | |
pod2man damianzaremba.man | \ | |
sed 's/\.\\" Automatically generated by .*//' | \ | |
sed "s/\.TH DAMIANZAREMBA.MAN 1 \".*\" \".*\" \".*\"/.TH DAMIANZAREMBA 1 \"$(date +%Y)\" \"Damian Zaremba\" \"Damian Zaremba\"/" | \ | |
gzip > man/man1/damianzaremba.1.gz | |
man -M "$( pwd )/man/" damianzaremba |
This file contains hidden or 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
#!/usr/bin/python | |
import threading | |
import Queue | |
class Runner(threading.Thread): | |
def __init__(self, queue): | |
threading.Thread.__init__(self) | |
self.queue = queue | |
def run(self): |
This file contains hidden or 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 re | |
''' | |
I stoled these from http://stackoverflow.com/questions/319279/how-to-validate-ip-address-in-python | |
''' | |
def is_valid_ipv4(ip): | |
"""Validates IPv4 addresses. | |
""" | |
pattern = re.compile(r""" | |
^ |
This file contains hidden or 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
#!/usr/bin/env perl | |
use strict; | |
use LWP::Simple; | |
use Data::Dumper; | |
my $dump_folder = '/home/damian/Pictures/xckd'; | |
my $base_perm_url = 'http://xkcd.com'; | |
my $base_image_url = 'http://imgs.xkcd.com/comics'; | |
sub get_cid { |