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 bash | |
PLAYER='vlc' | |
lsof -nP -S2 -bw -u $UID|\ | |
awk '/\/tmp\/Flash/ { gsub("[^0-9]","",$4); print "/proc/"$2"/fd/"$4 }'|\ | |
xargs ${PLAYER} |
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
/* | |
* Simple example that shows how to set the requested Twitter access | |
* permissions on a per-user basis. | |
* | |
* For example, this is useful if you only require Direct Message permissions | |
* from a few users and simple read access for the rest. | |
* | |
* 1. Set up your application to request R/W/DM by default in | |
* the app settings (https://dev.twitter.com/apps/) | |
* 2. Set the OAUTH_KEY and OAUTH_SECRET environment variables and start this server. |
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
{ | |
name: 'photo', | |
mapping: 'photos', | |
convert: function(value, record) { | |
return value[0]; | |
} | |
}, |
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
class MyGeoResource(Resource): | |
def apply_sorting(self, objects, options=None): | |
if options and "longitude" in options and "latitude" in options: | |
return objects.distance(Point(options['latitude'], options['longitude'])).order_by('distance') | |
return super(MyGeoResource, self).apply_sorting(objects, options) | |
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
n% ipy /home/n/.config/ipython/profile_default | |
? -> Introduction and overview of IPython's features. | |
%quickref -> Quick reference. | |
help -> Python's own help system. | |
object? -> Details about 'object', use 'object??' for extra details. | |
profile_default [1]> åæ | |
File "<ipython-input-1-84a62556aeb2>", line 1 | |
åæ | |
^ |
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
*************************************************************************** | |
IPython post-mortem report | |
{'commit_hash': '<not found>', | |
'commit_source': '(none found)', | |
'ipython_path': '/home/n/python/lib/python2.7/site-packages/IPython', | |
'ipython_version': '0.11', | |
'os_name': 'posix', | |
'platform': 'Linux-2.6.38-13-generic-x86_64-with-Ubuntu-11.04-natty', |
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
### | |
### Bindings | |
### | |
unbind C-b | |
set -g prefix C-a | |
bind a send-prefix | |
# URL viewing | |
bind-key u capture-pane \; save-buffer /tmp/tmux-buffer \; run-shell "xterm -e 'cat /tmp/tmux-buffer | urlview'" |