This file contains 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
# Bash alias to open Github page for project in current working directory. | |
# Will use the current active branch if it exists remotely, or falls back to master. | |
alias github='br=$(git branch --contains HEAD | sed -rn "s/^\* //p"); if ! git ls-remote . | grep -q -e "refs/remotes/.*/${br}"; then br="master"; fi; xdg-open $(git config -l | sed -rn "s%remote.origin.url=git(@|://)(github.com)(:|/)(.+/.+).git%https://\2/\4/tree/${br}%p")' |
This file contains 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 | |
# A simple little script which prompts you to click a window and then disables | |
# the screensaver until it goes away. | |
WID=`xwininfo -int | awk '/Window id/ {print $4}'` | |
xdg-screensaver suspend "$WID" |
This file contains 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
getSelectionHTML = -> | |
# Everyone but IE supports DOM selections | |
if window.getSelection | |
sel = window.getSelection() | |
# IE Selections (Must come last to avoid messing with Opera) | |
else if document.selection | |
return document.selection.createRange().htmlText | |
# Fail safely | |
else | |
return "" |
This file contains 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 | |
"""Modification of PyGTK's EntryCompletion example with shell-like tab completion. | |
Tab works normally unless there's content, the cursor is at the end of it, | |
and nothing is selected, preserving intuitive tab-cycling behaviour in all | |
reasonable cases while still allowing comfortable tab completion. | |
(To tab-cycle into a field with content in it and then tab-complete, just press | |
End before you request completion) | |
If no completions are found, users may press Tab again to go to the next field. |
This file contains 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 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
[server] | |
Driver=CFontzPacket | |
## CrystalFontz packet driver (for CF631, CF633 & CF635) ## | |
[CFontzPacket] | |
# Select the LCD model [default: 633; legal: 631, 633, 635] | |
Model=631 | |
# Select the output device to use [default: /dev/lcd] | |
Device=/dev/ttyUSB0 |
This file contains 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
-- Reasonably efficient pagination without OFFSET | |
-- SQLite version (Adapted from MS SQL syntax) | |
-- Source: http://www.phpbuilder.com/board/showpost.php?p=10376515&postcount=6 | |
SELECT foo, bar, baz, quux FROM table | |
WHERE oid NOT IN ( SELECT oid FROM table | |
ORDER BY title ASC LIMIT 50 ) | |
ORDER BY title ASC LIMIT 10 |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="xhrproxy.js"></script> | |
<script> | |
setupXHRProxy(); | |
</script> | |
</head> |
This file contains 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
"""Template for custom Distutils commands with dependencies""" | |
from distutils.core import Command | |
commands = {} | |
try: | |
from third_party_package import something | |
class MyCommand(Command): | |
description = "Use ThirdPartyPackage™ to frob the project source" |
OlderNewer