Skip to content

Instantly share code, notes, and snippets.

View phillyqueso's full-sized avatar

Phillip Jacobs phillyqueso

View GitHub Profile
fizbo:go-twitter phillyqueso$ gomake
6g -o _go_.6 api.go status.go user.go search.go util.go rate_limit.go http_auth.go
api.go:68: undefined: error
api.go:69: undefined: error
api.go:95: undefined: error
api.go:528: undefined: error
util.go:27: undefined: error
http_auth.go:50: undefined: error
http_auth.go:90: undefined: error
http_auth.go:109: undefined: error
<?php
class liveNode {
private $host = '127.0.0.1';
private $port = '5566';
static private $queue;
private $timeout = 5000; // milliseconds
<?php
/*
* Multithreaded Hello World server. Uses proceses due
* to PHP's lack of threads!
* @author Ian Barber <ian(dot)barber(at)gmail(dot)com>
*/
function worker_routine() {
$context = new ZMQContext();
// Socket to talk to dispatcher
<?php
$queue = new ZMQSocket(new ZMQContext(), ZMQ::SOCKET_REQ, "MySock1");
$queue->connect("tcp://127.0.0.1:5555");
$res = $queue->send("test")->recv();
echo "got ".$res;
?>
@phillyqueso
phillyqueso / gist:1214162
Created September 13, 2011 15:45
mongoose getters, not working.
var mongoose = require('mongoose'),
db = mongoose.connect('mongodb://localhost/blog'),
Schema = mongoose.Schema,
fields = ['createdDate', 'canComment', 'story', 'title', 'user'];
var commentsSchema = new Schema({
user : { type: String },
comment : { type: String },
createdDate : { type: Date, default: Date.now }
});
@phillyqueso
phillyqueso / app.js
Created August 30, 2011 14:42 — forked from codesplicer/app.js
Streaming twitter API + socket.io
// SETUP
// Get the required modules
var express = require("express"),
mustachio = require("mustachio"),
sys = require("sys"),
app = express.createServer();
// Configure the app
app.configure(function() {
@phillyqueso
phillyqueso / gist:1049252
Created June 27, 2011 16:44
mongoose query
client.on('moreLoad', function(obj) {
Posts.find({_id: { $lt: obj.data.postId } }).sort('createdDate', 1).limit(perPage).execFind(function(err, res) {
console.log(err);
console.log(res);
if (res != null) {
client.emit('loadPosts', {data: res});
}
});
});