start new:
tmux
start new with session name:
tmux new -s myname
# coding: utf-8 | |
''' | |
This is a little helper script to make it easier | |
to create single-file scripts with Pythonista, while | |
still taking advantage of the UI editor. | |
It'll essentially convert the .pyui file to a compact | |
string representation that you can embed directly | |
in your script. The code to unpack and load the UI | |
is also auto-generated for convenience. |
# coding: utf-8 | |
import ui | |
import os | |
from objc_util import ObjCInstance, ObjCClass | |
from operator import attrgetter | |
import time | |
import threading | |
import functools | |
import ftplib | |
import re |
# coding: utf-8 | |
# Barcode scanner demo for Pythonista | |
# Based on http://www.infragistics.com/community/blogs/torrey-betts/archive/2013/10/10/scanning-barcodes-with-ios-7-objective-c.aspx | |
from objc_util import * | |
from ctypes import c_void_p | |
import ui | |
import sound | |
found_codes = set() |
__author__ = 'Amal G Jose' | |
from datetime import datetime | |
from dateutil import relativedelta | |
##Aug 7 1989 8:10 pm | |
date_1 = datetime(1989, 8, 7, 20, 10) | |
##Dec 5 1990 5:20 am | |
date_2 = datetime(1990, 12, 5, 5, 20) |
function check_for_virtual_env { | |
[ -d .git ] || git rev-parse --git-dir &> /dev/null | |
if [ $? == 0 ]; then | |
local ENV_NAME=`basename \`pwd\`` | |
if [ "${VIRTUAL_ENV##*/}" != $ENV_NAME ] && [ -e $WORKON_HOME/$ENV_NAME/bin/activate ]; then | |
workon $ENV_NAME && export CD_VIRTUAL_ENV=$ENV_NAME | |
fi | |
elif [ $CD_VIRTUAL_ENV ]; then |
/** | |
* World's simplest express server | |
* - used to serve index.html from /public | |
*/ | |
var express = require('express'); | |
var serveStatic = require('serve-static'); | |
var app = express(); | |
app.use(serveStatic(__dirname + '/public')); |
#!/usr/bin/env python | |
# Reflects the requests from HTTP methods GET, POST, PUT, and DELETE | |
# Written by Nathan Hamiel (2010) | |
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler | |
from optparse import OptionParser | |
class RequestHandler(BaseHTTPRequestHandler): | |
def do_GET(self): |