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
.alignment--left { | |
.public-DraftStyleDefault-block { | |
text-align; left; | |
} | |
} | |
.alignment--center { | |
.public-DraftStyleDefault-block { | |
text-align; center; | |
} | |
} |
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
export const GoogleApi = function(opts) { | |
opts = opts || {} | |
const apiKey = opts.apiKey; | |
const libraries = opts.libraries || []; | |
const client = opts.client; | |
const URL = 'https://maps.googleapis.com/maps/api/js'; | |
const googleVersion = '3.22'; | |
let script = null; |
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
class FooSerializer(serializers.ModelSerializer): | |
# Any subclass of a RelatedField, which would normally have a queryset | |
bar = serializers.HyperlinkedRelatedField( | |
queryset=Bar.objects.none(), # don't unintentionally expose information | |
) | |
def __init__(self, *args, **kwargs): | |
# Make sure that self.fields is populated | |
super().__init__(*args, **kwargs) | |
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
""" | |
Example code for connecting to Stardog (http://stardog.com/) with | |
Python's RDFLib (http://github.com/rdflib). | |
See longer description: http://lawlesst.github.io/notebook/rdflib-stardog.html | |
""" | |
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 | |
from json import load, JSONEncoder | |
from argparse import ArgumentParser, FileType | |
from re import compile | |
import sys | |
float_pat = compile(r'^-?\d+\.\d+(e-?\d+)?$') | |
charfloat_pat = compile(r'^[\[,\,]-?\d+\.\d+(e-?\d+)?$') |
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
# Hosts/domain names that are valid for this site; required if DEBUG is False | |
# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts | |
ALLOWED_HOSTS = [ | |
'yourdomain.tld', | |
'.compute-1.amazonaws.com', # allows viewing of instances directly | |
] | |
import requests | |
EC2_PRIVATE_IP = None | |
try: |
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
/* | |
Taken and cribbed from blog.datalicious.com/free-download-all-australian-postcodes-geocod | |
May contain errors where latitude and longitude are off. Use at own non-validated risk. | |
*/ | |
SET NAMES utf8; | |
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; | |
DROP TABLE IF EXISTS postcodes_geo; |
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 argparse | |
import sys | |
import jinja2 | |
import markdown | |
TEMPLATE = """<!DOCTYPE html> | |
<html> |
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
import gdata | |
import json | |
import requests | |
# More examples: | |
# https://github.com/millioner/Python-contact-importer/blob/master/contact_importer/providers/google.py | |
# https://github.com/jtauber/django-friends/blob/master/friends/importer.py | |
# GData with access token | |
token = gdata.gauth.OAuth2Token( |
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
//This is a port of Ken Perlin's "Improved Noise" | |
// http://mrl.nyu.edu/~perlin/noise/ | |
// Originally from http://therandomuniverse.blogspot.com/2007/01/perlin-noise-your-new-best-friend.html | |
// but the site appears to be down, so here is a mirror of it | |
class Perlin { | |
var $p, $permutation, $seed; | |
var $_default_size = 64; |
NewerOlder