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
javascript: | |
window.location = 'launchpro://?url=' + encodeURIComponent('launchpro://?url='+ encodeURIComponent('pushpin://add?url={{' + location.href + '}}&title={{' + document.title + '}}&tags=[list:📌'+ location.href +'|without tag= |!to_check_out|ios app url-scheme=ios app url-scheme|ebook=reading ebook]')); |
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
# if you want to capture some kind of user input during a script (e.g. Xcode Run Script Phase) you can use this neato trick | |
# | |
# it will give up after 20 seconds of no input and return an empty string, in the case you you hit Build and just walk away | |
# | |
# note: only works on macs b/c it uses AppleScript | |
echo -n $(osascript -e 'set notes to the text returned of (display dialog "Build Notes" default answer "" buttons {"OK"} giving up after 20)') | |
# e.g. | |
BUILD_NOTES=`echo -n $(osascript -e 'set notes to the text returned of (display dialog "Build Notes" default answer "" buttons {"OK"} giving up after 20)')` |
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
# vim: set ft=python : | |
from __future__ import print_function | |
import json | |
import sys | |
import datetime | |
from redis import StrictRedis as Redis |
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 | |
# Ref: http://ubuntuforums.org/showthread.php?t=1751455 | |
# Install required libs | |
apt-get -y install build-essential python-dev libjpeg62-dev zlib1g-dev libfreetype6-dev liblcms1-dev | |
# Link to correct location | |
if [ -d /usr/lib/x86_64-linux-gnu ]; then | |
# Ubuntu 11.04 64bit | |
ln -sf /usr/lib/x86_64-linux-gnu/libfreetype.so /usr/lib/ | |
ln -sf /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/ | |
ln -sf /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib/ |
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 | |
# | |
# Jamie Kirkpatrick, November 2009. <jkp@kirkconsulting.co.uk> | |
# Released under the BSD license. | |
# | |
""" | |
Experimental code to add asyncronous functionality to WSGI applications | |
running under the Tornado webserver. Uses greenlet to spin micro-threads | |
which can be suspended and resumed within a single thread as required. |
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
(function(){function f(b){b=b||window;for(var g=b.document.getElementsByTagName("link"),a=0,d=g.length;a<d;a++){var e=g[a],c=e.href;if(c&&/stylesheet/i.test(e.rel)){c=c.replace(/(&|%5C?)forceReload=\d+/,"");var h="forceReload="+(new Date).valueOf();e.href=c+(c.indexOf("?")>=0?"&":"?")+h}}a=0;for(d=b.frames.length;a<d;a++)f(b.frames[a])}f()})(); |
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
# -*- coding:utf-8 -*- | |
""" | |
Backup Google Reader Items to WordPress eXtended RSS (Wordpress Export Format) | |
Download Feeds from http://www.google.com/reader/atom/feed/http://yourblogdomain.com/yourfeed?n=1000 | |
(1000 = number of items) | |
Usage: reader2wordpress.py google_atom.xml http://yourblogdomain.com/ | |
Licensed under BSD. |
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
// | |
// profiler.h | |
// Quick and dirty profiler | |
// | |
// Created by Niels Gabel on 9/1/08. | |
// | |
// Copyright 2010 Niels Gabel | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. |
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
def queryset_generator(queryset, chunksize=1000): | |
""" | |
Iterate over a Django Queryset ordered by the primary key | |
This method loads a maximum of chunksize (default: 1000) rows in its | |
memory at the same time while django normally would load all rows in its | |
memory. Using the iterator() method only causes it to not preload all the | |
classes. | |
Note that the implementation of the generator does not support ordered query sets. |
OlderNewer