As configured in my dotfiles.
start new:
tmux
start new with session name:
| function computeSunrise(day, sunrise) { | |
| /*Sunrise/Sunset Algorithm taken from | |
| http://williams.best.vwh.net/sunrise_sunset_algorithm.htm | |
| inputs: | |
| day = day of the year | |
| sunrise = true for sunrise, false for sunset | |
| output: | |
| time of sunrise/sunset in hours */ |
| # -*- coding: utf-8 -*- | |
| """ | |
| Go to Google Bookmarks: https://www.google.com/bookmarks/ | |
| On the bottom left, click "Export bookmarks": https://www.google.com/bookmarks/bookmarks.html?hl=en | |
| After downloading the html file, run this script on it to generate a KML. | |
| """ |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Leaflet</title> | |
| <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.css" /> | |
| <script src="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.js"></script> | |
| <script src="http://maps.google.com/maps/api/js?v=3.2&sensor=false"></script> | |
| <script src="http://matchingnotes.com/javascripts/leaflet-google.js"></script> | |
| </head> | |
| <body> |
As configured in my dotfiles.
start new:
tmux
start new with session name:
| from django.core.cache import cache | |
| from django.http import HttpResponseForbidden | |
| from functools import wraps | |
| from django.utils.decorators import available_attrs | |
| def ratelimit(limit=10,length=86400): | |
| """ The length is in seconds and defaults to a day""" | |
| def decorator(func): | |
| def inner(request, *args, **kwargs): | |
| ip_hash = str(hash(request.META['REMOTE_ADDR'])) |