Sets a cloudflare subdomain to your IP every 15 minutes.
$ brew install jq
$ crontab -e
# add this ->
30 * * * * /Users/canada/Documents/update-ip.sh
import shelve | |
import functools | |
def cache(filename): | |
def decorating_function(user_function): | |
def wrapper(*args, **kwds): | |
key = str(hash(functools._make_key(args, kwds, typed=False))) |
FROM python:3 | |
ADD . /code/ | |
WORKDIR /code/ | |
# ENV LANG C.UTF-8 if this is uncluded, no error | |
RUN python open_file.py |
Sets a cloudflare subdomain to your IP every 15 minutes.
$ brew install jq
$ crontab -e
# add this ->
30 * * * * /Users/canada/Documents/update-ip.sh
{ | |
"metadata": { | |
"name": "", | |
"signature": "sha256:7be03c2818d177cfe7b64eb1a0a1b7b108fb5b5a5764e3f27e4261fe691ac9ed" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ |
Operations to perform: | |
Synchronize unmigrated apps: floppyforms, rest_framework_bulk, admin_export, impersonate, rest_framework, localflavor, rosetta, django_filters, naviance_sso, dajax, ldap_groups, customers, grappelli, compressor, djangobower, raven_compat, dajaxice, pagination, ckeditor, scaffold_report, autocomplete_light, djcelery, widget_tweaks, responsive_dashboard, massadmin, constance | |
Apply all migrations: administration, benchmark_grade, counseling, discipline, attendance, schedule, custom_field, contenttypes, simple_import, sis, sessions, reversion, work_study, auth, admissions, report_builder, standard_test, engrade_sync, database, admin, alumni, grades, default, benchmarks, volunteer_track | |
Synchronizing apps without migrations: | |
Creating tables... | |
Creating table ldap_groups_ldapgroup_groups | |
Creating table ldap_groups_ldapgroup | |
Creating table celery_taskmeta | |
Creating table celery_tasksetmeta | |
Creating table djcelery_intervalschedule |
from visual import * | |
c = 3e08 | |
v = vector(0.5*c, 0, 0.9*c) | |
t = 0 | |
dt = 1e-9 | |
gamma_x = 1/sqrt(1 - (v.x/c)**2) | |
gamma_y = 1/sqrt(1 - (v.y/c)**2) | |
gamma_z = 1/sqrt(1 - (v.z/c)**2) | |
#function to increase resolution of shape from ints to floats from http://stackoverflow.com/a/477610 | |
def drange(start, stop, step): |
def find_non_unique(model, *fields): | |
from collections import defaultdict | |
d = defaultdict(list) | |
for instance in model.objects.all(): | |
d[tuple(getattr(instance, field) for field in fields)].append(instance) | |
return filter(lambda dups: len(dups)>1, d.values()) |