Skip to content

Instantly share code, notes, and snippets.

View wjessop's full-sized avatar
🤖

Will Jessop wjessop

🤖
View GitHub Profile
class VisitorSession
include Mongoid::Document
field :visits, :type => Integer, :default => 1
field :project_id
end
# I only want map to return a specific project
project_id = '2a6a03'
# Define the map function in javascript
map = <<EOF
function() {
if (this.project_id == '#{project_id}') {
emit(this.visits, {visits: this.visits})
}
}
class VisitorSession
include Mongoid::Document
field :visits, :type => Integer, :default => 1
field :project_id
def visits_for_project
map = <<EOF
function() {
if (this.project_id == '#{project_id}') {
c = Curl::Easy.perform("http://someplace") do |curl|
curl.headers["Host"] = "poo.com"
curl.headers["X-Bewbs"] = "yes"
end
ZMQ_QUEUE(1) 0MQ Manual ZMQ_QUEUE(1)
NAME
zmq_queue - forwarding device for request-reply messaging
SYNOPSIS
To be written.
DESCRIPTION
To be written.
require 'rubygems'
require 'zmq'
z = ZMQ::Context.new
s = z.socket(ZMQ::UPSTREAM)
s.connect "tcp://127.0.0.1:4010"
while true
puts s.recv
end
psql (8.4.3)
Type "help" for help.
postgres=# create database win;
CREATE DATABASE
postgres=# \c win
psql (8.4.3)
You are now connected to database "win".
win=# create table great(excellent varchar(10));
CREATE TABLE
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.45 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create database bagoshite;
Query OK, 1 row affected (0.02 sec)
mysql> use bagoshite
#!/usr/bin/ruby
#
# This script installs to /usr/local only. To install elsewhere you can just
# untar http://github.com/mxcl/homebrew/tarball/master anywhere you like.
#
#
# 30th March 2010:
# Added a check to make sure user is in the staff group. This was a problem
# for me, and I think it was due to me migrating my account over several
# versions of OS X. I cannot verify that for sure, and it was tested on
@interface Connection : NSObject
// …
+ (void)setRequestHeaders:(NSArray *)headers;
+ (NSArray *)getRequestHeaders;
//…
@end