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 example would probably work best if you're using | |
| * an MVC framework, but it can be used standalone as well. | |
| * | |
| * This example also assumes you are using Predis, the excellent | |
| * PHP Redis library available here: | |
| * https://github.com/nrk/predis | |
| */ |
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
| def tip(msg); puts; puts msg; puts "-"*100; end | |
| # | |
| # 30 Ruby 1.9 Tips, Tricks & Features: | |
| # http://www.igvita.com/2011/02/03/new-ruby-19-features-tips-tricks/ | |
| # | |
| tip "Upgrading to Ruby 1.9 is simple: rvm install 1.9.2 && rvm --default 1.9.2" | |
| tip "Ruby 1.9 supports named captures in regular expressions!" |
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
| Index: sapi/cli/config.w32 | |
| =================================================================== | |
| --- sapi/cli/config.w32 (revision 308839) | |
| +++ sapi/cli/config.w32 (working copy) | |
| @@ -6,7 +6,8 @@ | |
| ARG_ENABLE('cli-win32', 'Build console-less CLI version of PHP', 'no'); | |
| if (PHP_CLI == "yes") { | |
| - SAPI('cli', 'php_cli.c', 'php.exe'); | |
| + SAPI('cli', 'php_cli.c php_http_parser.c php_cli_server.c', 'php.exe'); |
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
| package com.mojolly.backchat | |
| package redis | |
| package resque | |
| import com.mojolly.backchat.redis.resque.Resque.{ResqueWorkerActor} | |
| import net.liftweb.json._ | |
| import JsonAST._ | |
| import JsonDSL._ | |
| import java.net.InetAddress | |
| import com.redis.ds.{ RedisDeque, RedisDequeClient } |
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 php | |
| <?php | |
| $paths = array(); | |
| if (isset($_SERVER['argv'])) | |
| { | |
| $paths = $_SERVER['argv']; | |
| array_shift($paths); | |
| if (!$paths) |
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
| @_1 = -> | |
| # sum of multiples of 3 or 5 (not both) under 1K | |
| answer = 0 | |
| for n in [1...1000] | |
| if n % 3 == 0 or n % 5 == 0 | |
| answer += n |
##Using libuv and http-parser to build a webserver
Ryan Dahl, @ryah
Talk as a screencast: http://vimeo.com/24713213
Source, Part I: http://t.co/utoIM93
Source, Part II: http://bit.ly/iBgnIA
##Node.js on windows
Bert Belder
http://2bs.nl/nodecamp.pdf
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
| ''' | |
| redis_simple_chat.py | |
| Written June 24, 2011 by Josiah Carlson | |
| Released under the GNU GPL v2 | |
| available: http://www.gnu.org/licenses/gpl-2.0.html | |
| Other licenses may be available upon request. |
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
| function nano() { | |
| nano=`which nano`; | |
| if ([ -e "$1" ] && ! [ -w "$1" ]) || ( ! [ -e "$1" ] && ! [ -w "`dirname $1`" ]); then | |
| read -n 1 -p "$1 is not editable by you. sudo [y/N]? " y | |
| [ "$y" == "y" ] || [ "$y" == "Y" ] && echo -e "\n" && sudo $nano $@ | |
| else | |
| $nano $@ | |
| fi | |
| } |