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
/** | |
* A complete HACK to emulate most of functionality of http_build_url() from http_pecl | |
*/ | |
ob_start(); | |
empty( $this->scheme ) || printf( '%s://', $this->scheme ); | |
empty( $this->user ) || printf( '%s%s@', $this->user, | |
empty( $this->pass ) ?'': sprintf( ':%s', $this->pass )); | |
empty( $this->host ) || print( $this->host ); | |
empty( $this->port ) || printf( ':%d', $this->port ); | |
empty( $this->path ) ? print( '/' ) : print( $this->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
use \Doctrine\ORM\Tools\EntityGenerator, | |
\Doctrine\Common\ClassLoader, | |
\Doctrine\ORM\Configuration, | |
\Doctrine\Common\Cache\ArrayCache, | |
\Doctrine\ORM\EntityManager, | |
\Doctrine\ORM\Mapping\Driver\DatabaseDriver, | |
\Doctrine\ORM\Tools\DisconnectedClassMetadataFactory; | |
// autoload | |
$classLoader = new ClassLoader( 'Entities', __DIR__ ); |
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
var express = require('express') | |
, http = require('http') | |
, connect = require('connect') | |
, io = require('socket.io'); | |
var app = express(); | |
/* NOTE: We'll need to refer to the sessionStore container later. To | |
* accomplish this, we'll create our own and pass it to Express | |
* rather than letting it create its own. */ | |
var sessionStore = new connect.session.MemoryStore(); |
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
$ dig A nodecopter.com | |
; <<>> DiG 9.8.1-P1 <<>> A nodecopter.com | |
;; global options: +cmd | |
;; Got answer: | |
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 46757 | |
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 4 | |
;; QUESTION SECTION: | |
;nodecopter.com. IN A |
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
#! Requried Headers | |
headers: 'User-Agent': 'Ciao/Client 1.0' | |
#> Github API call for node.js README | |
port: 443 | |
protocol: 'https:' | |
host: 'api.github.com' | |
path: '/repos/joyent/node/readme' | |
headers: 'Accept': 'application/json' |
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
(function () { | |
var tag = document.createElement('script'); | |
tag.type = 'text/javascript'; | |
tag.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'embed.ingredo.com/v1/embed?referer=' + window.location.href; | |
var body = document.getElementsByTagName('head')[0]; | |
body.appendChild(tag); | |
}).call(this); |
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
var zmq = require("zmq"); | |
var socket = zmq.socket("xrep"); | |
socket.bindSync("ipc:///tmp/zmq-issue"); | |
socket.on("message", function(envelope, _, name) { | |
socket.send([envelope, new Buffer(0), "Hello, " + name.toString()]); | |
}); |
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 | |
if [[ `uname -s` == 'Darwin' ]]; then | |
brew update | |
brew install libtool autoconf automake | |
else | |
sudo apt-get update | |
sudo apt-get install -y libtool autoconf automake uuid-dev git-core | |
fi |
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 | |
DIVIDER="--------------------------------------------------------------" | |
EOL="" | |
if [ -z "$1" ]; then | |
echo $DIVIDER | |
echo " Hack 0.01 (Jan 18th 2008)." | |
echo " Usage: " $0 "[-action]" | |
echo " Choose which action to perform:" |
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 | |
DIVIDER="--------------------------------------------------------------" | |
EOL="" | |
if [ -z "$1" ]; then | |
echo $DIVIDER | |
echo " Wifi 0.01 (Jan 17th 2008)." | |
echo " Usage: " $0 "[-action]" | |
echo " Choose which action to perform:" |
OlderNewer