Skip to content

Instantly share code, notes, and snippets.

View alukach's full-sized avatar
🍊

Anthony Lukach alukach

🍊
View GitHub Profile
@alukach
alukach / Default (Linux).sublime-keymap
Last active August 29, 2015 13:55
My SublimeText3 Setup
[
{"keys": ["ctrl+shift+0"], "command": "insert_snippet","args": {"contents": "import ipdb; ipdb.set_trace();"}},
{"keys": ["ctrl+shift+o"], "command": "prompt_open_folder"},
]
/usr/bin/env python -c import numpy
/usr/bin/env python -c import numpy
==> Downloading ftp://ftp.ldeo.columbia.edu/pub/MB-System/mbsystem-5.4.2168.tar.gz
Already downloaded: /Library/Caches/Homebrew/mbsystem-5.4.2168.tar.gz
==> Verifying mbsystem-5.4.2168.tar.gz checksum
tar xf /Library/Caches/Homebrew/mbsystem-5.4.2168.tar.gz
==> Downloading ftp://ftp.ldeo.columbia.edu/pub/MB-System/annual.gz
Already downloaded: /Library/Caches/Homebrew/mbsystem--levitus-5.4.2168.gz
==> Verifying mbsystem--levitus-5.4.2168.gz checksum
==> ./configure --disable-static --enable-shared
@alukach
alukach / survey-datalist.cmd
Last active August 29, 2015 13:57
Creating first plot from MB-System Cookbook (section 3.2 Plotting Data)
#! /bin/csh -f
#
# Shellscript to create Postscript plot of swath sonar data
# Created by macro mbm_plot
#
# This shellscript created by following command line:
# mbm_plot -F -1 -I survey-datalist -N
#
# Define shell variables used in this script:
set PS_FILE = survey-datalist.ps
@alukach
alukach / tileservers.md
Last active August 29, 2015 13:58
TileServer Packages

TileStream is a high-performance map tile server powered by MBTiles files.

  • Written in: Javascript (node.js)

  • Made by: Mapbox

  • Limitations

    • Only serves maps that are generated with TileMill (can not yet render tiles)
@alukach
alukach / ftp_server.py
Created April 14, 2014 22:46
Basic FTP server with awareness of file paths
from twisted.protocols.ftp import FTP, FTPFactory, FTPRealm
from twisted.cred.portal import Portal
from twisted.cred.checkers import FilePasswordDB
from twisted.internet import reactor
import os
# Sources
# - http://twistedmatrix.com/trac/attachment/ticket/1579/ftp_server_example.py
# - http://stackoverflow.com/questions/9790121/twisted-simple-file-completed-event-for-ftp-server

Anthony's Dos and Don'ts of Seattle

Downtown

Despite the fact that Seattle is a neighborhood-oriented city, you will probably end up downtown at some point. If you want to go shopping, this is where that would be.

  • Places
    • Seattle Art Museum: If you're feeling artsy.
    • Pike Place Market: It's kind of just something you have to do.
  • Food
from collections import OrderedDict
import inflect
p = inflect.engine()
ORDINAL_NUMBER_MAP = OrderedDict()
for i in range(1, 300): # Highest avenue in New York is 271st
word_form = p.number_to_words(i) # 1 -> 'one'
@alukach
alukach / hstore_mixin.py
Last active August 29, 2015 14:04
Django Hstore Mixin - Support storing all standard data types within Hstore.
import datetime
import json
from django.db import models
from django_hstore import hstore
serialize = lambda d: (
json.dumps(d.isoformat()) if isinstance(d, datetime.datetime) else
json.dumps(d)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alukach
alukach / thermometer.py
Last active August 29, 2015 14:12
BeagleBone LCD Thermometer
#!/usr/bin/python
"""
This script assumes that you have a LCD connected to a RaspberryPi or BeagleBone
Black as as described in this tutorial:
https://learn.adafruit.com/character-lcd-with-raspberry-pi-or-beaglebone-black
along with a temperature sensor as described in this tutorial:
https://learn.adafruit.com/measuring-temperature-with-a-beaglebone-black
"""
from collections import deque