Skip to content

Instantly share code, notes, and snippets.

Avatar

Guðmundur Hreiðarsson gudmundurh

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

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:

View plupload-runtimes.js
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(',');
View makepagesmultipleof.tex
% 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{
@gudmundurh
gudmundurh / gist:76324
Created Mar 9, 2009
Fork of Social Space by Pall Thayer (GPLv3) http://pallit.lhi.is/microcodes/
View gist:76324
#!/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 $_;
}
@gudmundurh
gudmundurh / gist:76322
Created Mar 9, 2009
Fork of CNN dada by Páll Thayer (GPLv3) http://pallit.lhi.is/microcodes/
View gist:76322
#!/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" }