Skip to content

Instantly share code, notes, and snippets.

View sigurdga's full-sized avatar

Sigurd Gartmann sigurdga

  • Trondheim, Norway
View GitHub Profile

Keybase proof

I hereby claim:

  • I am sigurdga on github.
  • I am sigurdga (https://keybase.io/sigurdga) on keybase.
  • I have a public key whose fingerprint is 2AB5 8FD5 CFC4 0E90 AC07 61B5 92E2 2B10 A02E 9526

To claim this, I am signing this object:

@sigurdga
sigurdga / etc-varnish-default.vcl
Created May 20, 2014 11:33
Here, I'm setting up a default backend at port 8080, and a websocket route to port 3001
backend default {
.host = "127.0.0.1";
.port = "8080";
}
backend skravvel {
.host = "127.0.0.1";
.port = "3001";
}
@sigurdga
sigurdga / etc-default-varnish
Created May 20, 2014 11:30
This is what I'm running
DAEMON_OPTS="-a :80 \
-T localhost:6082 \
-f /etc/varnish/default.vcl \
-S /etc/varnish/secret \
-s malloc,256m"
@sigurdga
sigurdga / geocode-glib-fail.js
Last active December 12, 2015 04:28
Trying to use gjs to do geocode queries… I found a small example in python, and converted it to javascript: http://cheesehead-techblog.blogspot.no/2012/11/geoclue-vs-geocode-glib.html My javascript version does not work - I don't get any results. And I just checked and saw that copy-pasting the python code also got no results back.
const GeocodeGlib = imports.gi.GeocodeGlib;
let location = new GeocodeGlib.Object();
location.add('city','Milwaukee');
let result = location.resolve();
print(result);
@sigurdga
sigurdga / geocode-glib-reverse-fail.js
Last active December 12, 2015 04:28
I cannot get GeocodeGlib to work. At all. I want to get the name of the location. As I understand, a Yahoo library is used under the hood. Trying the same examples as http://developer.yahoo.com/boss/geo/docs/free_YQL.html#table_pf does not work. This is javascript and gobject introspection.
const GeocodeGlib = imports.gi.GeocodeGlib;
let location = new GeocodeGlib.Object.new_for_coords(37.416275, -122.025099);
let result = location.resolve();
print(result);
@sigurdga
sigurdga / gist:2971386
Created June 22, 2012 08:39
Code checker combining pylint, pyflakes and pep8
#!/bin/sh
echo "$(tput setab 1 )====== pylint $1 ======$(tput op)"
pylint --output-format=colorized --reports=n $1
echo "$(tput setab 1 )====== pep8 ======$(tput op)"
pep8 --show-source $1
echo "$(tput setab 1 )====== pyflakes ======$(tput op)"
pyflakes $1