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
""" | |
jython version of http://hipstersinc.com/blog/2007/5/16/jruby_processingorg_howto/ | |
Spinning color cube controled by mouse motion. | |
1. Install Jython | |
2. Add Processing's core.jar to CLASSPATH: export CLASSPATH=/Applications/Processing.app/Contents/Resources/Java/core.jar | |
3. ~/jython2.5b3/bin/jython sketch.py | |
""" | |
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 | |
# Wrapper for IronPython on the Mac. Install Mono from here: | |
# http://www.go-mono.com/mono-downloads/download.html | |
# | |
# Thanks to this Japanese article; code truly is the universal language: | |
# http://textdirected.googlepages.com/IronPythonUnderMacOSXmonoJ.html | |
# | |
exec /Library/Frameworks/Mono.framework/Versions/Current/bin/mono /Library/Frameworks/Mono.framework/Versions/Current/lib/IPCE/ipy/ipy.exe "$@" |
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
// | |
// Output a Couch view as CSV, fields ordered per the 'fields' local variable. | |
// This is designed for use with FoxyCouch, the RESTful Foxycart order manager. | |
// | |
// To install in a FoxyCouch[1] instance, use CouchApp to 'pull' the design documents | |
// and then make a 'lists' directory inside 'manager_screen'; then put the contents | |
// of this into 'orders_as_csv.js'. Then do a 'couchapp push'. | |
// | |
// (Yeah, I realize now that I should move the rest of FoxyCouch to CouchApp, because | |
// it rocks.) |
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
// Comment on http://sixrevisions.com/javascript/6-advanced-javascript-techniques-you-should-know/ | |
pageContainer.innerHTML = array('', | |
'<h1>' + pageTitle + '</h1>', | |
'<div id="content">', | |
' <p>' + pageContent + '</p>', | |
' <div id="author_bio">', | |
' <p>' + authorBio + '</p>', | |
' </div>', | |
'</div>', |
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 | |
# chkconfig: - 85 15 | |
# description: controls the pool of PHP FastCGI daemons used to handle \ | |
# dynamic requests from nginx. | |
PHP_SCRIPT=/opt/nginx/bin/world_php_fcgi | |
RETVAL=0 | |
case "$1" in | |
start) | |
$PHP_SCRIPT | |
RETVAL=$? |
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
[ | |
Define_Tag('Decode_Raw', -Required='input'); | |
Local('output' = bytes()); | |
Local('ndx' = 1); | |
While(#ndx < #input->Length); | |
if(#input->Get(#ndx) == '%'); | |
local: 'byte' = string(#input->Substring(#ndx+1, 2)); |
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
<?php if (!defined('APPLICATION')) exit(); | |
/* | |
Copyright 2008, 2009 FoxyCart, LLC | |
This is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. | |
This is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | |
You should have received a copy of the GNU General Public License along with this file. If not, see <http://www.gnu.org/licenses/>. | |
Contact Fred Alger at fred [dot] alger [at] foxycart [dot] com | |
*/ |
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 hammer to fix group permissions on Plesk vhosts. | |
# | |
# Plesk creates httpdocs directories with correct permissions initially, | |
# and they work properly over FTP (sort of), however, they require special | |
# love to let Apache write to them; namely putting Apache in the psacln | |
# group, making sure that everyone's httpdocs are owned by that group, | |
# and setting the setgid bit on httpdocs and all of its subdirectories | |
# so that new directories created by Apache inherit the proper permissions |
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 | |
# super-simple request per minute statistics from an Apache log file | |
# watch it live, now with JSON output! | |
# while [ /bin/true ]; do sh logstats.sh ; sleep 60 ; done | |
# | |
LOGFILE=/var/log/apache2/access_log | |
HOUR=`date +%H` | |
MIN=`date +%M` | |
MIN=`expr $MIN - 1` |
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 | |
CLOUDANT_USER="myusername" | |
CLOUDANT_PASS="mypassword" | |
CLOUDANT_DB="mydb" | |
DATE=`date +"%Y-%m-%d\$%H.%M"` | |
BACKUP_NAME="${CLOUDANT_DB}_backup_${DATE}" | |
echo "Creating database named ${BACKUP_NAME}" |
OlderNewer