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
# usage: gen_token(n) | |
# Pass this the numerical ID of an URL at the cross reference table | |
# and you'll get a tinyurl-like base36 string | |
gen_token=lambda n,cs="0123456789abcdefghijklmnopqrstuvwxyz":(lambda b=len(cs):cs[n%b]+gen_token((n-(n%b))/b))() if n else "" |
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
package ntlmptunnel; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.OutputStream; | |
import java.net.InetSocketAddress; | |
import java.net.ServerSocket; | |
import java.net.Socket; | |
import org.apache.commons.httpclient.HostConfiguration; | |
import org.apache.commons.httpclient.NTCredentials; |
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
<body> | |
<select id="teste"> | |
<option>item 1</option> | |
<option>item 2</option> | |
<option>item 3</option> | |
<option>item 4</option> | |
</select> | |
<script src="js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script> | |
<script type="text/javascript" charset="utf-8"> | |
$(document).ready(function() |
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/bash | |
SVN_USERNAME=$1 | |
GIT_REPO=$2 | |
SVN_TRUNK_REPO=$3 | |
if [ -z $1 ]; then | |
echo "Usage: $0 SVN_USERNAME GIT_REPO SVN_TRUNK_REPO" | |
exit 1 | |
fi | |
git svn clone --username $SVN_USERNAME $SVN_TRUNK_REPO |
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
<html> | |
<head><title>wonderstache</title></head> | |
<body> | |
<script type="text/x-mustache-yadayada" name="widgetTemplate1"> | |
<div id="notComplicatedWidget"> | |
{{ name }} | |
</div> | |
</script> | |
<div id="widgetContainer"> | |
{{>//script[name=widgetTemplate1]}} |
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
/* | |
* Q: What is this? | |
* A: A sample file that uses mustache to render a single html tmeplate (including partials) on the serverside but keeps those partials intact so that they can be used by the client-side as well (ie. browser) | |
* | |
* Q: How is this useful? | |
* A: To you, I have little idea. I'm doing this because I want to be able to fully render a page on the server and then refresh parts of it on the client, while reusing the widget presentation code. As the widget code is in the file, I just have to bring in mustache.js, fetch new data, and have it render the parts I need to update. And I'd like to keep it all in a single file also. | |
* | |
* Q: Isn't that template code broken? | |
* A: Yes. I'll come back to it as I plan to patch Mu to support xpath partials natively. | |
* */ |
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
<html><head> | |
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> | |
<!-- This software application is Twitter-Ware. If you like it, | |
use it, or have something to say, follow and tell me on Twitter | |
at @codemonkeyism | |
http://twitter.com/codemonkeyism | |
Blog at http://www.codemonkeyism.com | |
Webssite http://www.simple-kanban.com | |
See MIT license at bottom. |
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/bash | |
SCRIPT_DIR="`cd $(dirname $0);pwd`" | |
NGINX_VERSION="0.8.54" | |
PCRE_VERSION="8.01" | |
INSTALL_PREFIX="$SCRIPT_DIR/binaries" | |
DOWNLOAD_DIR="/tmp/src" | |
LD_LIBRARY_PATH="$INSTALL_PREFIX/lib:$LD_LIBRARY_PATH" |
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
mysql --silent --skip-column-names -u <username> -p<password> <database> -e "show tables" | awk '{ print "drop table " $1 ";"}' | mysql -u <username> -p<password> <password> |
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
from django.contrib import admin | |
def AutoManaged(clazz): | |
""" The AutoManaged decorator can be used on model classes which you want to have available | |
on the administration site with the stock admin forms. | |
Example usage: | |
@AutoManaged | |
class MyModel(models.Model): |
OlderNewer