Skip to content

Instantly share code, notes, and snippets.

View urschrei's full-sized avatar
💭
🌒

Stephan Hügel urschrei

💭
🌒
View GitHub Profile
// Settings in here override those in "LSP/LSP.sublime-settings",
{
"clients":
{
"rls":
{
"auto_complete_triggers": [ {"selector": "source.rust", "characters": ".:"} ],
"diagnostics_highlight_style": "box",
"command": ["rustup", "run", "nightly", "rls"],
@urschrei
urschrei / twitrend
Created February 1, 2011 00:14
retrieve trending topics from a WOEID location
#!/usr/bin/env python
# encoding: utf-8
"""
twitrend.py
"""
import sys
import os
import tweepy
Microsoft (R) COFF/PE Dumper Version 14.00.24215.1
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file target/release/lonlat_bng.dll
File Type: DLL
Section contains the following exports for lonlat_bng-f8cb032e62ae16ed.dll
@urschrei
urschrei / mkflask.sh
Created May 12, 2012 14:46
Bootstrap a Flask project
#!/bin/bash -e
# opinionated Flask bootstrap script
# assumes you'll be using MySQL/PG, Fabric, Webassets, WTForms and Blueprints
# creates a virtualenv and an Alembic migrations system
# The script will halt on any error, and remove the project dir, if it created one
# accepts a single argument: a new directory name under which to create the project
# check that Python is installed
type python >/dev/null 2>&1 || { echo >&2 "Python doesn't appear to be installed. Aborting."; exit 1; }
@urschrei
urschrei / playground.rs
Last active February 2, 2016 09:59 — forked from anonymous/playground.rs
Threaded send/receive using channels in Rust
use std::thread;
use std::sync::mpsc::{ channel, Sender };
enum Wrapped {
A(f64),
B(f64),
}
fn produce_a(sender: Sender<Wrapped>) {
for i in 0 .. 5 {
@urschrei
urschrei / jenks2.py
Created September 22, 2013 00:28 — forked from llimllib/jenks2.py
import json
from pprint import pprint as pp
def jenks_matrices_init(data, n_classes):
#fill the matrices with data+1 arrays of n_classes 0s
lower_class_limits = []
variance_combinations = []
for i in xrange(0, len(data)+1):
temp1 = []
temp2 = []
@urschrei
urschrei / map.geojson
Created August 22, 2013 18:32
via:geojson.io
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@urschrei
urschrei / call.txt
Last active December 19, 2015 19:49
This gist is now a proper repo: https://github.com/urschrei/lovecraft
Iä!
@urschrei
urschrei / CMakeCache.txt
Created July 8, 2013 12:32
OS X 10.8.4 Python 2.7.5 from Python.org Numpy 1.7.1 from pip OpenCV dependencies from Homebrew OpenCV built from source
# This is the CMakeCache file.
# You'll have to modify all instances of /users/sth to your own user path
# Modified PYTHON_LIBRARY:FILEPATH setting: /Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib
# For build in directory: /Users/sth/dev/py_tesseract/release
# CMAKE_INSTALL_PREFIX:PATH=/usr/bin
# In order to use Python bindings, prepend /Users/sth/dev/py_tesseract/release:lib to $PYTHONPATH
# It was generated by CMake: /usr/local/Cellar/cmake/2.8.11.1/bin/cmake
# You can edit this file to change values found and used by cmake.
# If you do not want to change any of the values, simply exit the editor.
# If you do want to change a value, simply edit, save, and exit the editor.
@urschrei
urschrei / latlong.py
Created May 13, 2013 20:07
Plot a dict of Lat, Lon points in an image. Requires the PIL.
# Courtesy of Charlie Loyd (@vruba), it's a black box for now
# Expects a dict of points, 'points' with keys 'Lat.', and 'Lon.'
from PIL import Image
from math import *
# these are London-specific
latrange = [51, 52]
lonrange = [-1, 1]