Hi:
perl -e 'print "hello world!\n"'
A simple filter:
perl -ne 'print if /REGEX/'
Filter out blank lines (in place):
# -*- coding: utf-8 -*- | |
# test_docstrings.py | |
import pytest | |
def test_lambdas(): | |
# Create a lambda and test it | |
doubler = lambda x: " ".join([x, x]) | |
assert doubler("fun") == "fun fun" | |
# Add a docstring to the lambda |
new function() | |
{ | |
/** | |
* Execute Macro | |
* | |
* @returns {void} | |
*/ | |
this.exec = function() | |
{ |
Hi:
perl -e 'print "hello world!\n"'
A simple filter:
perl -ne 'print if /REGEX/'
Filter out blank lines (in place):
if [[ -z $PS1 ]] # no prompt? | |
### if [ -v PS1 ] # On Bash 4.2+ ... | |
then # non-interactive | |
... | |
else # interactive | |
... | |
fi |
ply_url = 'https://pypi.python.org/packages/source/p/ply/ply-3.4.tar.gz' | |
slimit_url = 'https://pypi.python.org/packages/source/s/slimit/slimit-0.8.1.zip' | |
print 'Downloading SlimIt...' | |
from urllib import urlretrieve | |
import tarfile | |
import zipfile | |
import shutil | |
import os | |
try: |
(function () { | |
this.uniqid = function (pr, en) { | |
var pr = pr || '', en = en || false, result; | |
this.seed = function (s, w) { | |
s = parseInt(s, 10).toString(16); | |
return w < s.length ? s.slice(s.length - w) : (w > s.length) ? new Array(1 + (w - s.length)).join('0') + s : s; | |
}; | |
result = pr + this.seed(parseInt(new Date().getTime() / 1000, 10), 8) + this.seed(Math.floor(Math.random() * 0x75bcd15) + 1, 5); |
# sounder.py | |
# play each of the .caf sounds inside the Pythonista.app | |
import os, os.path, scene, sound | |
framesPerSound = 60 | |
pythonistaDir = os.path.expanduser('~/Pythonista.app') | |
#print(os.listdir(pythonistaDir)) | |
soundFileExtention = '.caf' | |
wallpaperAppIcon = ('/AppIcon76x76@2x~ipad.png', '/[email protected]') |
# Update: This looks like a far better solution... | |
# `console.set_idle_timer_disabled(flag)` | |
# Disable or enable the idle timer (which puts the device to sleep after a certain period of inactivity). | |
# noDoze.py -- keep relaunching yourself to prevent | |
# your iOS device from falling asleep. | |
import notification, time, urllib | |
def argsString(argv): |
Portions taken from http://www.cs.utexas.edu/~mitra/csSpring2011/cs327/cx_mac.html (in case that link ever dies.)
Assume you've got homebrew installed.
Download the following files from Oracle
# | |
# Hydrogen is a lightweight GUI framework for Pythonista | |
# | |
# Hydrogen - https://gist.github.com/BashedCrab/5924965 | |
# | |
# HydrogenLayouts - https://gist.github.com/BashedCrab/6103019 | |
# | |
# HydrogenDemo - https://gist.github.com/BashedCrab/5953776 | |
# |