Skip to content

Instantly share code, notes, and snippets.

View domoritz's full-sized avatar
📊
charting new territory

Dominik Moritz domoritz

📊
charting new territory
View GitHub Profile
@domoritz
domoritz / wos.php
Created March 10, 2012 19:32 — forked from pol/wos.php
Web of Science API access with ruby, python and php libs
<?php
$auth_url = "http://search.isiknowledge.com/esti/wokmws/ws/WOKMWSAuthenticate?wsdl";
$auth_client = @new SoapClient($auth_url);
$auth_response = $auth_client->authenticate();
$search_url = "http://search.isiknowledge.com/esti/wokmws/ws/WokSearchLite?wsdl";
$search_client = @new SoapClient($search_url);
$search_client->__setCookie('SID',$auth_response->return);
$search_array = array(
@domoritz
domoritz / unique_chars.py
Created April 21, 2012 12:09
Get number of unique characters in a file.
#!/usr/bin/env python
"""
This prints the number of unique characters from the input. Input can either be a command line argument or stdin.
Works with python 2.7 and 3.2.
Use python unique_chars.py -h to get more information.
"""
import collections
@domoritz
domoritz / intersperse.py
Created May 1, 2012 17:25
Haskell's intersperse for python
# http://learnyouahaskell.com/modules
intersperse = lambda e,l: sum([[x, e] for x in l],[])[:-1]
@domoritz
domoritz / osg.diff
Created June 7, 2012 18:35
Patch for Open Scene Graph 3.0.1 for Mac
Index: OpenSceneGraph/trunk/src/osgViewer/DarwinUtils.mm
===================================================================
--- a/src/osgViewer/DarwinUtils.mm (revision 12292)
+++ b/src/osgViewer/DarwinUtils.mm (revision 12790)
@@ -48,4 +48,23 @@
namespace osgDarwin {
+//
+// Lion replacement for CGDisplayBitsPerPixel(CGDirectDisplayID displayId)
+//
@domoritz
domoritz / example.py
Created June 30, 2012 22:08
PopIt Python bindings
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from popit import build_popit_api
from pprint import pprint
api = build_popit_api(instance = 'professors', user = 'your email', password = 'your password')
# Create
print("CREATE")
@domoritz
domoritz / create_read_only_user.sql
Created August 29, 2012 13:57
Create read only user in postgres
Script moved to `ckanext/datastore/bin`.
@domoritz
domoritz / 678191.csv
Last active February 1, 2016 06:56
Make weather data more user friendly
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 19 columns, instead of 2 in line 7.
STATION,STATION_NAME,DATE,PRCP,TMAX,TMIN,AWND,WT14,WT01,WT17,WT05,WT02,WT22,WT04,WT13,WT16,WT08,WT18,WT03
GHCND:USW00024233,SEATTLE TACOMA INTERNATIONAL AIRPORT WA US,20120101,0,128,50,47,1,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999
GHCND:USW00024233,SEATTLE TACOMA INTERNATIONAL AIRPORT WA US,20120102,109,106,28,45,-9999,1,-9999,-9999,-9999,-9999,-9999,1,1,-9999,-9999,-9999
GHCND:USW00024233,SEATTLE TACOMA INTERNATIONAL AIRPORT WA US,20120103,8,117,72,23,-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,1,-9999,-9999,-9999
GHCND:USW00024233,SEATTLE TACOMA INTERNATIONAL AIRPORT WA US,20120104,203,122,56,47,-9999,1,-9999,-9999,-9999,-9999,-9999,1,1,-9999,-9999,-9999
GHCND:USW00024233,SEATTLE TACOMA INTERNATIONAL AIRPORT WA US,20120105,13,89,28,61,-9999,1,-9999,-9999,-9999,-9999,-9999,-9999,1,-9999,-9999,-9999
GHCND:USW00024233,SEATTLE TACOMA INTERNATIONAL AIRPORT WA US,20120106,25,44,22,22,1,1,-9999,-9999,-9999,-9999,-9999,-9999,1,-9999,-9999,-9999
GHCND:USW00024233,SEATTLE TACOMA INTERNATI

Keybase proof

I hereby claim:

  • I am domoritz on github.
  • I am domoritz (https://keybase.io/domoritz) on keybase.
  • I have a public key ASALJkwRzksMt0MehPVMrPU-7jeWRD7pHCmyhrw7iCrA4Ao

To claim this, I am signing this object:

@domoritz
domoritz / result.txt
Created February 19, 2016 17:41
Simple sudoku solver with froward checking and look ahead
5 1 7 | 6 9 8 | 2 3 4
2 8 9 | 1 3 4 | 7 5 6
3 4 6 | 2 7 5 | 8 9 1
- - - + - - - + - - -
6 7 2 | 8 4 9 | 3 1 5
1 3 8 | 5 2 6 | 9 4 7
9 5 4 | 7 1 3 | 6 8 2
- - - + - - - + - - -
4 9 5 | 3 6 2 | 1 7 8
7 2 3 | 4 8 1 | 5 6 9
@domoritz
domoritz / Gemfile
Created March 4, 2016 00:23
Gemfile for github pages
source 'https://rubygems.org'
require 'json'
require 'open-uri'
versions = JSON.parse(open('https://pages.github.com/versions.json').read)
gem 'github-pages', versions['github-pages']