Skip to content

Instantly share code, notes, and snippets.

View gudmundurh's full-sized avatar

Guðmundur Hreiðarsson gudmundurh

View GitHub Profile
@gudmundurh
gudmundurh / gist:76322
Created March 9, 2009 14:04
Fork of CNN dada by Páll Thayer (GPLv3) http://pallit.lhi.is/microcodes/
#!/usr/bin/perl
use LWP::Simple;
`clear`;
$width = `tput cols`;
$height = `tput lines`;
$text = get 'http://rss.cnn.com/rss/edition.rss';
$text =~ s/<[^>]+>//g;
@words = split ' ', $text;
sub color { "\e[", 31+int(rand(7)), ";40m", @_, "\e[0m" }
@gudmundurh
gudmundurh / gist:76324
Created March 9, 2009 14:07
Fork of Social Space by Pall Thayer (GPLv3) http://pallit.lhi.is/microcodes/
#!/usr/bin/perl
use LWP::Simple;
$social_text = get('http://twitter.com/statuses/public_timeline.rss');
$social_text =~ s/>\s+</></g;
@social_space = $social_text =~ /(\s+)/g;
sub bg { "\e[37;", 40+int(rand(7)), 'm', @_, "\e[0m" }
foreach(@social_space){
print bg $_;
}
% LaTeX macro for making the page count of a LaTeX
% document a multiple of some particular number
\def\addemptypage{
\pagebreak
\thispagestyle{empty}
\phantom{abc}
}
\def\makepagesmultipleof#1{
var Upload = {
getDefaultRuntimes: function () {
var runtimes = ['flash', 'html4'];
var platform = navigator.platform || '';
if (navigator.platform === 'Win32' && this.isSilverlightInstalled('4.0.0.0'))
runtimes.unshift('silverlight');
return runtimes.join(',');

Keybase proof

I hereby claim:

  • I am gudmundurh on github.
  • I am gudmundurh (https://keybase.io/gudmundurh) on keybase.
  • I have a public key ASC0PZxiFpLUys57FRKaRhqBQmrVzn28sMB1ge4BpHyq6Ao

To claim this, I am signing this object:

@gudmundurh
gudmundurh / spiir_api.py
Created September 25, 2018 21:11
Quick'n'dirty Python 3 class converting Mine Spiir into an API
import requests
import json
from urllib.parse import urlencode
import time
import logging
import datetime
logger = logging.getLogger("espiir")
def die(reason):