I hereby claim:
- I am jhargis on github.
- I am jhargis (https://keybase.io/jhargis) on keybase.
- I have a public key whose fingerprint is 0FCF 328B 353D 9282 C929 80EA 8620 C622 7D44 B2EA
To claim this, I am signing this object:
/* | |
* Mclarens Bar: Redis based Instant Messaging | |
* Nikhil Marathe - 22/04/2010 | |
* A simple example of an IM client implemented using | |
* Redis PUB/SUB commands so that all the communication | |
* is offloaded to Redis, and the node.js code only | |
* handles command interpretation,presentation and subscribing. | |
* | |
* Requires redis-node-client and a recent version of Redis |
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: gunicorn-initscript | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Should-Start: $nginx | |
# Default-Start: 30 2 3 4 5 | |
# Default-Stop: 70 0 1 6 | |
# Short-Description: virtualenv + gunicorn + nginx debian init script | |
# Description: virtualenv + gunicorn + nginx debian init script |
I hereby claim:
To claim this, I am signing this object:
# NAT Traversal via UPnP Port Mapping | |
# Written by Nikos Fotoulis <nikofot at gmx.com> | |
# This code is public domain. | |
# | |
# Tested on Thomsom TG858v7 modem router. | |
# UPnP is hairy. May not work with other routers | |
# Feedback is welcome. | |
import re, thread, socket, traceback as tb, random | |
from time import sleep |
# coding=utf-8 | |
# | |
# Copyright 2014 Leo Moll | |
# | |
# Authors: Leo Moll and Contributors (see CREDITS) | |
# | |
# Thanks to Mark Johnson for btsyncindicator.py which gave me the | |
# last nudge needed to learn python and write my first linux gui | |
# application. Thank you! | |
# |
# temporary hack to address bug with vagrant-vbguest installation | |
# https://github.com/mitchellh/vagrant/issues/4962 | |
if awk "BEGIN {exit `vagrant -v` == "1.7.1" ? 0 : 1 }" | |
then | |
sudo sed -i .original 's/\*\*opts/opts/g' /opt/vagrant/embedded/gems/gems/vagrant-1.7.1/lib/vagrant/machine.rb | |
fi |
Original post at: http://pythonexcels.com/python-excel-mini-cookbook/
To get you started, I’ve illustrated a number of common tasks you can do with Python and Excel. Each program below is a self contained example, just copy it, paste it and run it. A few things to note:
These examples were tested in Excel 2007, they should work fine in earlier versions as well after changing the extension of the file within the wb.SaveAs()
statement from .xlsx to .xls
If you’re new to this, I recommend typing these examples by hand into IDLE, IPython or the Python interpreter, then watching the effect in Excel as you enter the commands. To make Excel visible add the line excel.Visible = True after the excel =win32.gencache.EnsureDispatch('Excel.Application')
line in the script
These are simple examples with no error checking. Make sure the output files doesn’t exist before running the script. If the script crashes, it may leave a copy of Excel running in the background. Open the Windows T
# Convert Clarion date values from 5 digit integers to DATE types in Postgresql with a custom function | |
\d inv | |
Table "public.inv" | |
Column | Type | Modifiers | |
------------+---------------+-------------------------------------------------- | |
create_dt | integer | | |
from psycopg2.extras import DictCursor | |
from django.db import connections | |
def get_cursor(alias='default', cursor_factory=None): | |
# map from django's ORM layer to the raw DB cursor. | |
wrapped_conn = connections[alias] | |
# hack to ensure connection is immediately opened: | |
if wrapped_conn.connection is None: |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
"""Create ``.pls`` playlists from music filenames. | |
Specify a path to be recursively searched for music files. | |
According to an `unofficial PLS format specification`__, the attribute | |
``NumberOfEntries`` can be placed *after* all entries. This allows to iterate | |
through filenames without keeping details for each entry in memory. |