Skip to content

Instantly share code, notes, and snippets.

@JobsDong
JobsDong / gistools.py
Created January 8, 2014 07:58
Mercator to BD09, BD09 to GCJ03
#!/usr/bin/python
#-*- coding=utf-8 -*-
"""用于和地理信息有关的数据处理
"""
__author__ = ['"wuyadong" <[email protected]>']
import math
@pepijndevos
pepijndevos / repyl.py
Last active July 28, 2016 06:51
A Redis-based interactive Python shell.
from __future__ import print_function
import threading
import code
import sys
import contextlib
from time import sleep
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
@nlothian
nlothian / Penn Treebank II Tags.md
Last active April 15, 2025 13:39
Penn Treebank II Tags
@Bouke
Bouke / gist:10454272
Last active September 22, 2023 17:23
Install FreeTDS, unixODBC and pyodbc on OS X

First, install the following libraries:

$ brew install unixodbc
$ brew install freetds --with-unixodbc

FreeTDS should already work now, without configuration:

$ tsql -S [IP or hostname] -U [username] -P [password]
locale is "en_US.UTF-8"

locale charset is "UTF-8"

@natelandau
natelandau / .bash_profile
Last active June 23, 2025 21:53
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@arnaudbreton
arnaudbreton / async-process-jasmine.Spec.js
Last active August 29, 2015 14:00
The 5 best front-end developer tools blogpost: testing with Mocha and Jasmine
AsyncProcess = require('./async-process').AsyncProcess
describe('AsyncProcess', function() {
var asyncProcess;
beforeEach(function() {
asyncProcess = new AsyncProcess();
});
it('should process 42', function() {
@arvidfm
arvidfm / asyncio-tornado.py
Last active May 18, 2025 18:05
Running Tornado on asyncio's event loop, including 'yield from' support in request handlers
import asyncio
import tornado.concurrent
import tornado.ioloop
import tornado.web
import tornado.platform.asyncio
import tornado.httpclient
class ReqHandler(tornado.web.RequestHandler):
async def get(self):
@mateuszwenus
mateuszwenus / save_restore_dependencies.sql
Last active June 19, 2025 14:29
PostgreSQL: How to handle table and view dependencies
create table deps_saved_ddl
(
deps_id serial primary key,
deps_view_schema varchar(255),
deps_view_name varchar(255),
deps_ddl_to_run text
);
create or replace function deps_save_and_drop_dependencies(p_view_schema varchar, p_view_name varchar) returns void as
$$
@carljm
carljm / db.py
Last active March 18, 2025 15:37
SQLAlchemy and Postgres autocommit
"""
SQLAlchemy, PostgreSQL (psycopg2), and autocommit
See blog post: http://oddbird.net/2014/06/14/sqlalchemy-postgres-autocommit/
"""
from contextlib import contextmanager
from sqlalchemy import create_engine, event
from sqlalchemy.orm import sessionmaker, Session as BaseSession
@staltz
staltz / introrx.md
Last active July 13, 2025 10:33
The introduction to Reactive Programming you've been missing