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
-- Size of the board, 40 is nice and fast | |
-- 100 is doable but only runs at 3 fps with current board algorithm | |
-- 10 is fun and good for making sure everything works | |
-- 40 is ideal | |
Size=40 | |
Generation=0 | |
World = { cols=Size, rows=HEIGHT/(WIDTH/Size), last=0.0 } | |
Cell = { size = WIDTH/World.cols, color=color(0, 62, 255, 255) } | |
Directions = { |
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
/* | |
As of version 1.1.2, Propane will load and execute the contents of | |
~Library/Application Support/Propane/unsupported/caveatPatchor.js | |
immediately following the execution of its own enhancer.js file. | |
You can use this mechanism to add your own customizations to Campfire | |
in Propane. | |
Below you'll find two customization examples. |
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
// | |
// This is the result of about an hour's delving into PHP's hairy-ass serialization internals. | |
// PHP provides a session_decode function, however, it's only useful for setting the contents of | |
// $_SESSION. Say, for instance, you want to decode the session strings that PHP stores in its | |
// session files -- session_decode gets you nowhere. | |
// | |
// There are a bunch of nasty little solutions on the manual page[1] that use pretty hairy regular | |
// expressions to get the job done, but I found a simple way to use PHP's unserialize and recurse | |
// through the string extracting all of the serialized bits along the way. | |
// |
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
#!/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}" |
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
#!/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 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
#!/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 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
<?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 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
[ | |
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 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
#!/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 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
// 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>', |