Add this in your ini file:
[alembic:exclude]
tables = spatial_ref_sys
In env.py:
import re
| <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
| class MY_Session extends CI_Session{ | |
| private $sess_use_redis = TRUE; | |
| private $redis = ''; | |
| public function __construct($params = array()) { | |
| //parent::__construct(); | |
| $this->CI =& get_instance(); |
| @media only screen and (min-width: 320px) { | |
| /* Small screen, non-retina */ | |
| } | |
| @media | |
| only screen and (-webkit-min-device-pixel-ratio: 2) and (min-width: 320px), | |
| only screen and ( min--moz-device-pixel-ratio: 2) and (min-width: 320px), | |
| only screen and ( -o-min-device-pixel-ratio: 2/1) and (min-width: 320px), |
| /* | |
| Assuming you have an enum type like this. | |
| You want to rename 'pending' to 'lodged' | |
| */ | |
| CREATE TYPE dispute_status AS ENUM('pending', 'resolved', 'open', 'cancelled'); | |
| BEGIN; | |
| ALTER TYPE dispute_status ADD VALUE 'lodged'; | |
| UPDATE dispute SET status = 'lodged' WHERE status = 'pending'; |
| curl \ | |
| --verbose \ | |
| --request OPTIONS \ | |
| http://localhost:3001/api/configuration/visitor \ | |
| --header 'Origin: http://localhost:9292' \ | |
| --header 'Access-Control-Request-Headers: Origin, Accept, Content-Type' \ | |
| --header 'Access-Control-Request-Method: GET' | |
| # http://nils-blum-oeste.net/cors-api-with-oauth2-authentication-using-rails-and-angularjs/#.UQJeLkp4ZyE |
| class Person (db.Document): | |
| name = db.StringField(required=True) | |
| created_date = db.ComplexDateTimeField(default=datetime.datetime.utcnow(), required=True) | |
| def to_dict(self): | |
| return helper.mongo_to_dict(self,[]) | |
| #helper.py | |
| def mongo_to_dict(obj, exclude_fields): |
Add this in your ini file:
[alembic:exclude]
tables = spatial_ref_sys
In env.py:
import re
| // Just before switching jobs: | |
| // Add one of these. | |
| // Preferably into the same commit where you do a large merge. | |
| // | |
| // This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
| // and then it quickly escalated into more and more evil suggestions. | |
| // I've tried to capture interesting suggestions here. | |
| // | |
| // Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
| // @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
| def test_root_output(client): | |
| resp = client.fetch('/') | |
| assert resp.code == 200 | |
| assert resp.body == 'Hello, world' | |
| def test_async_output(client): | |
| resp = client.fetch('/async') | |
| assert resp.code == 200 |
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"
| {% load staticfiles %} | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <style type="text/css"> | |
| @page { | |
| size: a4 portrait; | |
| margin: 1cm; | |
| margin-left:2cm; | |
| margin-right:2cm; |