This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
Thanks to: | |
@atogle, @evansml, @maxogden, @chachasikes, @peterfecteau, @mjumbewu | |
--> | |
<!doctype html> | |
<html> | |
<head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ "type": "MultiLineString", "coordinates": [ [ [ 2689354.393741, 235542.226547 ], [ 2689680 | |
.056343, 235500.585944 ] ], [ [ 2689680.056343, 235500.585944 ], [ 2689906.467823, 235472.771 | |
528 ] ], [ [ 2689906.467823, 235472.771528 ], [ 2690126.450528, 235442.482106 ] ], [ [ 269012 | |
6.450528, 235442.482106 ], [ 2690668.307707, 235371.693559 ] ], [ [ 2690668.307707, 235371.69 | |
3559 ], [ 2690967.117328, 235331.751372 ] ], [ [ 2690967.117328, 235331.751372 ], [ 2691110.1 | |
55178, 235313.934206 ] ], [ [ 2691110.155178, 235313.934206 ], [ 2691553.989137, 235251.74816 | |
8 ] ], [ [ 2691553.989137, 235251.748168 ], [ 2691994.852367, 235195.886479 ] ], [ [ 2691994. | |
852367, 235195.886479 ], [ 2692441.118122, 235136.569144 ] ], [ [ 2692441.118122, 235136.5691 | |
44 ], [ 2692455.314000, 235134.904336 ] ], [ [ 2692455.314000, 235134.904336 ], [ 2692662.259 | |
111, 235110.639190 ] ], [ [ 2692662.259111, 235110.639190 ], [ 2692885.033700, 235079.974076 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# run 'python manage.py shell'... | |
from django.contrib.gis.geos import Point | |
from septa.models import SeptaStops, SeptaRoutes | |
ONE_MILE = 0.015 | |
# This is around Devnuts HQ | |
my_location = Point(-75.142257, 39.965165) | |
nearby = my_location.buffer(ONE_MILE / 2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
say('hello') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> | |
<style> | |
body { | |
background-color: SkyBlue; | |
margin: 0px; | |
padding: 0px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="node-add-wrapper clear-block"> | |
<div class="node-column-sidebar"> | |
<?php if($sidebar): ?> | |
<?php print render($sidebar); ?> | |
<?php endif; ?> | |
</div> | |
<div class="node-column-main"> | |
<?php if($form): ?> | |
<?php print drupal_render_children($form); ?> | |
<?php endif; ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mjumbewu@lemur:~$ uname -a | |
Linux lemur 3.2.0-29-generic #46-Ubuntu SMP Fri Jul 27 17:03:23 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux | |
mjumbewu@lemur:~$ xinput list-props 12 | |
Device 'SynPS/2 Synaptics TouchPad': | |
Device Enabled (132): 1 | |
Coordinate Transformation Matrix (134): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000 | |
Device Accel Profile (254): 1 | |
Device Accel Constant Deceleration (255): 2.500000 | |
Device Accel Adaptive Deceleration (256): 1.000000 | |
Device Accel Velocity Scaling (257): 12.500000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# chadmasso has an interesting solution to using Django template tags in your | |
# Handlebars JS templates: precompile the template to Handlebars JS code, and | |
# then run the template through Django's template renderer. | |
# | |
# https://github.com/chadmasso/pencilthin | |
# | |
# Below are two possibilities for how a similar thing would be accomplished in | |
# django-jstemplate. | |
# | |
# 1) PREPROCESSOR(S) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from djangorestframework.renderers import JSONRenderer | |
from colorpicks.serializer import ColorSerializer | |
# NOTE: Resources are nominally much less present in the | |
# restframework2 branch. You use Serializers directly | |
# to achieve the same thing. | |
obj = ... | |
serializer = ColorSerializer(instance=obj) | |
data = serializer.data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os | |
from django.core.management import setup_environ | |
import settings | |
setup_environ(settings) | |
from django.conf import settings | |
from django.contrib.gis.gdal import CoordTransform, DataSource, OGRGeometry, OGRGeomType | |
from django.core.management.base import BaseCommand |
OlderNewer