This file contains hidden or 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
# -*- coding: utf-8 -*- | |
# License: BSD | |
import json | |
import os | |
import re | |
import time | |
from django import forms | |
from django.conf import settings |
This file contains hidden or 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
-- What if we have had an or keyword for creating types. | |
-- | |
-- Motivation: I often have something that is of few other things. | |
-- | |
-- Example 1 from my code: | |
-- this is my Main Msg. Main does not have any UI, it is an SPA, it delegates different | |
-- pages / Modules for UI and updated etc. | |
type Msg |
This file contains hidden or 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
### Keybase proof | |
I hereby claim: | |
* I am amitu on github. | |
* I am amitu (https://keybase.io/amitu) on keybase. | |
* I have a public key whose fingerprint is 0AE6 B0E1 9D24 7DD8 4DD0 2BB2 1514 4294 2930 5B79 | |
To claim this, I am signing this object: |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
from __future__ import division | |
from __future__ import absolute_import | |
from __future__ import print_function | |
from __future__ import unicode_literals | |
class Settings(object): | |
def __init__(self): | |
self.settings = dict( |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>KeepAlive</key> | |
<true/> | |
<key>Label</key> | |
<string>com.amitu.waitforit</string> | |
<key>ProgramArguments</key> | |
<array> |
This file contains hidden or 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 Crypto.Cipher import AES | |
from Crypto import Random | |
import base64 | |
import binascii | |
import struct | |
from django.db import models | |
from django.conf import settings | |
This file contains hidden or 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
.DEFAULT_GOAL := help | |
node_modules: ## Install dependencies. | |
node_modules: package.json | |
npm install | |
help: ## Show this help. | |
@IFS=$$'\n' ; \ | |
help_lines=(`fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##/:/'`); \ | |
for help_line in $${help_lines[@]}; do \ |
This file contains hidden or 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
preexec () { | |
START="$(python -c 'import time; print time.time()')" | |
LAST_CMD=$1 | |
} | |
precmd () { | |
LAST=$? | |
if [ -z ${START} ]; | |
then | |
else |
This file contains hidden or 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 CICharField(models.CharField): | |
def db_type(self, connection): | |
assert connection | |
return 'CITEXT' | |
def from_db_value(self, value, expression, connection, context): | |
if value and isinstance(value, str): | |
value = value.decode("utf-8") | |
return value |
This file contains hidden or 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
-- Function: clone_schema(text, text) | |
-- DROP FUNCTION clone_schema(text, text); | |
CREATE OR REPLACE FUNCTION clone_schema( | |
source_schema text, | |
dest_schema text, | |
include_recs boolean) | |
RETURNS void AS | |
$BODY$ |