An example PHP-WSGI app:
<?php
require_once 'php-wsgi.php';
run_with_cgi(function($environ, $start_response) {
try {
$start_response('200 OK', array('Content-Type' => 'text/plain'));
return array("Hello World\n");
#!/bin/sh | |
#RSS="http://www.reddit.com/r/Music/top/.rss?t=year" | |
RSS="http://www.reddit.com/r/listentothis/top/.rss?t=week" | |
YOUTUBE_RE="youtube\.com\/watch\?v=([^&\"]+)" | |
DATA=`curl --silent --compressed "$RSS"` | |
MATCHES=`echo $DATA | grep -Po "$YOUTUBE_RE"` | |
echo $DATA | hxselect -s '\n' -c item title | nl | |
for URL in $MATCHES; | |
do | |
cookiefile="/tmp/cookies-$( date +%s.%N ).txt" |
A very simple Sudoku puzzle solver written in Ruby. This script is free every | |
way you look at it. | |
## Example usage | |
$ cat puzzle | |
15 2 | |
7 8459 | |
8 4795 6 | |
5 6 |
<?php | |
class MockFunction { | |
public $func; | |
public $returns; | |
private function __construct($func) { | |
$this->func = $func; | |
$this->returns = array(); | |
} |
<?php | |
/** | |
* Copyright 2011 Neuman Vong. All rights reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions are met: | |
* | |
* 1. Redistributions of source code must retain the above copyright notice, | |
* this list of conditions and the following disclaimer. | |
* |
<?php | |
$ss = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); | |
$iface = '0.0.0.0'; | |
$port = 5432; | |
socket_set_option($ss, SOL_SOCKET, SO_REUSEADDR, 1); | |
socket_bind($ss, $iface, $port) or die("Could not bind\n"); | |
socket_listen($ss, 1); |