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
class VisitorSession | |
include Mongoid::Document | |
field :visits, :type => Integer, :default => 1 | |
field :project_id | |
end |
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
# 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}) | |
} | |
} |
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
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}') { |
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
c = Curl::Easy.perform("http://someplace") do |curl| | |
curl.headers["Host"] = "poo.com" | |
curl.headers["X-Bewbs"] = "yes" | |
end |
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
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. |
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
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 |
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
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 |
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
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 |
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/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 |
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
@interface Connection : NSObject | |
// … | |
+ (void)setRequestHeaders:(NSArray *)headers; | |
+ (NSArray *)getRequestHeaders; | |
//… | |
@end |