Skip to content

Instantly share code, notes, and snippets.

View skazhy's full-sized avatar

Kārlis Lauva skazhy

View GitHub Profile
@skazhy
skazhy / payload.xml
Last active March 15, 2022 05:47
Configuration profile example
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadIdentifier</key>
<string>com.fullcontact</string>
<key>PayloadType</key>
<string>Configuration</string>
@skazhy
skazhy / views.py
Created August 12, 2013 12:05
reverse_angular_url for Tornado
import tornado.web
class BaseHandler(tornado.web.RequestHandler):
def reverse_angular_url(self, name, *args):
# Works like regular reverse_url but replaces regex groups
# with :arg, so it can fit nicely in the AngularJS router
# for given route named "employee" "/company/(.*)/employees/(.*)$" ->
# reverse_angular_url("employee", "company_id", "employee_id")
# returns "/company/:company_id/employees/:employee_id"
@skazhy
skazhy / _latest_posts.html
Created April 5, 2012 09:01
Django templatetags example
ul>
{% for p in posts %}
<li><a href="{{ a.url }}">{{ a.title }}</a>
{% endfor %}
</ul>