Skip to content

Instantly share code, notes, and snippets.

@mdornseif
mdornseif / latitudedumper.py
Created July 13, 2011 21:43
Moving Google Latitude Data from one user to an other
# Google latitude backup
#
# This is a little helper to backup your location from Google Latitude to local disk.
# It saves data as JSON and as GPX.
# Usage is somewhat annoying:
#
# 1. get OACurl http://code.google.com/p/oacurl/
# 2. follow the steps in http://code.google.com/apis/latitude/oacurl.html to get strarted
# You will have to register a domain with Google Apps and jump through hoops
# 3. Renerate a Key and a Secret for "installed applications" on the google API console,
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@kylefinley
kylefinley / forms.py
Created January 3, 2012 16:16
webapp2: Password reset
import models
from wtforms import Form
from wtforms import fields
from wtforms import validators
class PasswordRestForm(Form):
email = fields.TextField('email')
class PasswordChangeForm(Form):
current = fields.PasswordField('Current Password')
@techtonik
techtonik / caller_name.py
Created March 21, 2012 19:29
Python - inspect - Get full caller name (package.module.function)
# Public Domain, i.e. feel free to copy/paste
# Considered a hack in Python 2
import inspect
def caller_name(skip=2):
"""Get a name of a caller in the format module.class.method
`skip` specifies how many levels of stack to skip while getting caller
name. skip=1 means "who calls me", skip=2 "who calls my caller" etc.
@greenido
greenido / gce-vpn-install.sh
Last active March 31, 2022 14:11
Installing vpn on GCE
#!/bin/sh
#
# Automatic configuration of a VPN on GCE debian-7-wheezy server.
# Tested only on debian-7-wheezy.
#
# This work is licensed under the Creative Commons Attribution-ShareAlike 3.0
# Unported License: http://creativecommons.org/licenses/by-sa/3.0/
#
# Thx to: https://github.com/sarfata/voodooprivacy/blob/master/voodoo-vpn.sh for the code/idea
#
@wojteklu
wojteklu / clean_code.md
Last active July 22, 2024 13:54
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@icopp
icopp / MacBook comparisons.md
Last active August 10, 2017 07:06
MacBook comparisons
Computamotron Size Price Storage Processor RAM Graphics Ports TB
MacBook Air 13" $999 128GB 1.6 to 2.7Ghz 2c 8GB Intel HD 6000 T2 + USB
MacBook Air 13" $1149 128GB 2.2 to 3.2Ghz 2c 8GB Intel HD 6000 T2 + USB
MacBook Air 13" $1199 256GB 1.6 to 2.7Ghz 2c 8GB Intel HD 6000 T2 + USB
old MacBook Pro 13" $1299 128GB 2.7 to 3.1Ghz 2c 8GB Intel Iris 6100 T2 + USB
MacBook 12" $1299 256GB 1.1 to 2.2Ghz 2c 8GB Intel HD 515 USB-C
MacBook Air 13" $1349 256GB 2.2 to 3.2Ghz 2c 8GB Intel HD 6000 T2 + USB
MacBook Air 13" $1399 512GB 1.6 to 2.7Ghz 2c 8GB Intel HD 6000 T2 + USB
new MacBook Pro 13" $1499 256GB 2.0 to 3.1Ghz 2c 8GB Intel Ir