System directories
| Method | Result |
|---|---|
| Environment.getDataDirectory() | /data |
| Environment.getDownloadCacheDirectory() | /cache |
| Environment.getRootDirectory() | /system |
External storage directories
| var waitForEl = function(selector, callback) { | |
| if (jQuery(selector).length) { | |
| callback(); | |
| } else { | |
| setTimeout(function() { | |
| waitForEl(selector, callback); | |
| }, 100); | |
| } | |
| }; |
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>J'ai quelque chose à dire</title> | |
| </head> | |
| <body style="background-color: #c33; padding-top: 5em;"> | |
| <p contenteditable style="text-align: center; font-size: 96px; font-family: Arial; color: #fff; font-weight: bold;">J'ai quelque chose à dire</p> | |
| </body> | |
| </html> |
| from django.conf.urls import patterns, url | |
| from django.contrib.auth.decorators import login_required | |
| from django.utils.translation import ugettext_lazy as _ | |
| from youproject.yourapp import views | |
| people_list = login_required(views.PeopleListView.as_view()) | |
| people_detail = login_required(views.PeopleDetailView.as_view()) |
System directories
| Method | Result |
|---|---|
| Environment.getDataDirectory() | /data |
| Environment.getDownloadCacheDirectory() | /cache |
| Environment.getRootDirectory() | /system |
External storage directories
Eric Bidelman has documented some of the common workflows possible with headless Chrome over in https://developers.google.com/web/updates/2017/04/headless-chrome.
If you're looking at this in 2016 and beyond, I strongly recommend investigating real headless Chrome: https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md
Windows and Mac users might find using Justin Ribeiro's Docker setup useful here while full support for these platforms is being worked out.
| # Based on https://github.com/ansible/ansible/blob/devel/examples/playbooks/postgresql.yml | |
| --- | |
| - hosts: postgres.vm | |
| sudo: yes | |
| tasks: | |
| - name: ensure latest postgres & postgis packages are latest | |
| action: apt pkg=$item update_cache=yes state=latest | |
| with_items: |
| <?php | |
| /* | |
| Plugin Name: Force SSL URL Scheme | |
| Plugin URI: https://gist.github.com/webaware/4688802 | |
| Description: Force the protocol scheme to be HTTPS when is_ssl() doesn't work | |
| Version: 1.0.0 | |
| Author: WebAware | |
| Author URI: http://webaware.com.au/ | |
| @ref: http://wordpress.org/support/topic/ssl-insecure-needs-35-compatibility |
| """ | |
| Safely deal with unicode(utf-8) in csv files | |
| removing nasty BOM surprises | |
| """ | |
| import csv | |
| import codecs | |
| """ | |
| Demo of json_required decorator for API input validation/error handling | |
| """ | |
| import inspect | |
| import functools | |
| import json | |
| from traceback import format_exception | |
| from flask import jsonify, request | |
| import sys |
| -- show running queries (pre 9.2) | |
| SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
| FROM pg_stat_activity | |
| WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
| ORDER BY query_start desc; | |
| -- show running queries (9.2) | |
| SELECT pid, age(clock_timestamp(), query_start), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |