This article is now published on my website: Prefer Subshells for Context.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
"""[application description here]""" | |
__appname__ = "[application name here]" | |
__author__ = "Stephan Sokolow (deitarion/SSokolow)" | |
__version__ = "0.0pre0" | |
__license__ = "GNU GPL 3.0 or later" | |
import logging |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ּ_בּ | |
בּ_בּ | |
טּ_טּ | |
כּ‗כּ | |
לּ_לּ | |
מּ_מּ | |
סּ_סּ | |
תּ_תּ | |
٩(×̯×)۶ | |
٩(̾●̮̮̃̾•̃̾)۶ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = Pavan Kumar Sunkara | |
email = [email protected] | |
username = pksunkara | |
[init] | |
defaultBranch = master | |
[core] | |
editor = nvim | |
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol | |
pager = delta |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from xml.dom import minidom | |
import json | |
config = { | |
'svg_file' : 'map.svg', | |
'js_file' : 'map.js', | |
'js_var' : 'svgMap' | |
} | |
svg = minidom.parse(config['svg_file']) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#301 Redirects for .htaccess | |
#Redirect a single page: | |
Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
#Redirect an entire site: | |
Redirect 301 / http://www.domain.com/ | |
#Redirect an entire site to a sub folder | |
Redirect 301 / http://www.domain.com/subfolder/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# This shows how to handle combined short options along with | |
# other long and short options. It does so by splitting them | |
# apart (e.g. 'tar -xvzf ...' -> 'tar -x -v -z -f ...') | |
while test $# -gt 0 | |
do | |
case $1 in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load Json into a Python object | |
import urllib2 | |
import json | |
req = urllib2.Request("http://localhost:81/sensors/temperature.json") | |
opener = urllib2.build_opener() | |
f = opener.open(req) | |
json = json.loads(f.read()) | |
print json | |
print json['unit'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
This script will attempt to open your webbrowser, | |
perform OAuth 2 authentication and print your access token. | |
It depends on two libraries: oauth2client and gflags. | |
To install dependencies from PyPI: | |
$ pip install python-gflags oauth2client |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
p:836:25:2,p:1226:25:2,p:204:25:2,p:251:25:2,p:235:25:2,p:333:25:2,p:153:25:2,p:1198:25:2,p:195:25:2,p:211:25:2,p:1196:25:2,p:1040:25:2,p:141:25:2,p:118:25:2,p:1197:25:2,p:194:25:2,p:262:25:2,p:144:25:2,p:158:25:2,p:47:25:2,p:261:25:2,p:95:25:2,p:1146:25:2,p:125:25:2,p:1321:25:2,p:292:25:2,p:164:25:2,p:1276:25:2,p:319:25:2,p:87:25:2,p:132:25:2,p:86:25:2,p:206:25:2,p:85:25:2,p:1061:25:2,p:293:25:2,p:1154:25:2,p:1153:25:2,p:1233:25:2,p:306:25:2,p:142:25:2,p:1177:25:2,p:89:25:2,p:1335:25:2,p:229:25:2,p:40:25:2,p:1155:25:2,p:162:25:2,p:167:25:2,p:1150:25:2,p:55:25:2,p:1320:25:2,p:175:25:2,p:1329:25:2,p:1348:25:2,p:157:25:2,p:311:25:2,p:1344:25:2,p:159:25:2,p:136:25:2,p:1183:25:2,p:1243:25:2,p:1228:25:2,p:59:25:2,p:127:25:2,p:630:25:2,p:58:25:2,p:652:25:2,p:1200:25:2,p:1063:25:2,p:241:25:2,p:848:25:2,p:1337:25:2,p:289:25:2,p:201:25:2,p:57:25:2,p:78:25:2,p:44:25:2,p:51:25:2,p:77:25:2,p:114:25:2,p:1346:25:2,p:190:25:2,p:52:25:2,p:267:25:2,p:75:25:2,p:792:25:2,p:239:25:2,p:200:25:2,p:834:25:2,p:847:25:2,p:1151:25:2,p |
OlderNewer