Similar to
https://gist.github.com/jonashaag/1200165
https://gist.github.com/ielshareef/3011156
here is a solution to implement DictFields.
#!/usr/bin/env python | |
import sys | |
import json | |
import urllib | |
import urllib2 | |
import argparse | |
def translate(target, text): | |
api = "https://www.googleapis.com/language/translate/v2?" | |
api_key = "AIzaSyBgBlJCogk_1Hd_7WaLQgLVbQss0_dvNUc" |
import sys | |
def convert(format, fname): | |
for line in open(fname, 'rb').readlines(): | |
if format == 'todos': | |
if line[-1:]=='\n' and line[-2:-1] !='\r': | |
line=line[-1:]='\r\n' | |
elif format == 'tolinux': | |
if line[-2:]=='\r\n': |
Similar to
https://gist.github.com/jonashaag/1200165
https://gist.github.com/ielshareef/3011156
here is a solution to implement DictFields.
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible). | |
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export. | |
var FORMAT_ONELINE = 'One-line'; | |
var FORMAT_MULTILINE = 'Multi-line'; | |
var FORMAT_PRETTY = 'Pretty'; | |
var LANGUAGE_JS = 'JavaScript'; | |
var LANGUAGE_PYTHON = 'Python'; |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
Author: Josef Jezek
sudo apt-get install python-setuptools
class Application(tornado.web.Application): | |
def __init__(self): | |
tornado.web.Application.__init__(self, handlers, **settings) | |
self.db_session = db_session | |
self.redis = redis.StrictRedis() | |
self.session_store = RedisSessionStore(self.redis) | |
class BaseHandler(tornado.web.RequestHandler): |
# -*- coding: utf-8 -*- | |
""" | |
Sessions module for the Tornado framework. | |
Milan Cermak <[email protected]> | |
This module implements sessions for Tornado. It can store | |
session data in files or MySQL databse, Memcached, Redis | |
and MongoDB. |
#!/bin/sh | |
# Auto-check for pep8 and flake8 proposed formatting checks automatically before committing bad code | |
# requires flake8 module | |
# The following is a list of the most common PEP 8 errors and warnings; to | |
# skip some just add them to the IGNORE variable (comma separated): | |
# E111 indentation is not a multiple of four | |
# E123 closing bracket does not match indentation of opening bracket's line | |
# E201 whitespace after '(' | |
# E202 whitespace before ')' |