Skip to content

Instantly share code, notes, and snippets.

View Veejay's full-sized avatar

Bertrand Chardon Veejay

View GitHub Profile
class PhotoCursor < ActiveRecord::Base
acts_as_singleton
# How many photos we're displaying at once in the photo moderation tool
SET_SIZE = 30
def self.get(primary)
>> PhotoCursor.put(true, 19)
=> 19
>> PhotoCursor.get(true)
=> 3
>> PhotoCursor.instance
=> #<PhotoCursor profile_photos_cursor: 3, other_photos_cursor: 1, created_at: "2010-08-08 12:40:54", updated_at: "2010-08-08 17:25:55">
>>
#!/bin/zsh
# vim:fdm=marker
#
# .zshrc
#
# by Sylvain Lebresne <lebresne@gmail.com>
#
# Prompt {{{1
module Criterion
@@registered = {}
def self.register(name, &block)
@@registered[name] = block
end
def self.format_age(date)
begin
age = Date.today.year - date.year
module Criterion
@@registered = {}
def self.register(name, &block)
@@registered[name] = block
end
# Returns a boolean indicating if the user passed
# as a parameter satisfies the criterion
function initialize(){
with(google.maps){
// Let's query the geocoding service to set the bounds for the map
var myOptions = {
zoom: 8,
mapTypeId: MapTypeId.ROADMAP
};
// The actual map
var map = new Map(document.getElementById("map_canvas"), myOptions);
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0px; padding: 0px }
#map_canvas { height: 100% }
</style>
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
TAILLE DU TABLEAU D'EMAILS: 40
EMAIL NUMERO 1 ==> ["Name: Christine Langer", "Current Zip code: 02368", "Home Phone: 732-236-8849", "Work Phone: --", "Email: cmlanger@gmail.com", "Contact Preference: No Preference Any Time", "Move Date: 6/1/2011", "Move Weight: 1 Bedroom, 2940 lbs", "Origin: Randolph, Massachusetts 02368", "Destination: Old Bridge, New Jersey ", "Requests and Comments: ", "Date Submitted: 5/27/2011 4:38:11 PM", "search for: Residential Movers", "to the following url http://www.123movers.com/companyflaglead.aspx?cid=679%3E&qid=%3C96%3B%3A9%3A&se=&type=rt%7Bnsl or calling us at 201 944 5900."]
EMAIL NUMERO 2 ==> [" Move Info:\t", " City: \tCambridge\t", " State:\tMA\t", " ZipCode:\t02138\t", " City: \tReading\t", " State:\tMA\t", " ZipCode:\t01867\t", " Type: \tPartial Home\t", " Move Date:\t06/09/2011\t", " Comments:\tI need to move a large, heavy treadmill.\t", " Name:\tPatricia Sullivan\t", " Email:\tprs118@aol.com\t", " Contact Number:\tHome: 617 491 1171 Ext-\t", " Contact Preference:\
ruby-1.9.2-p180 :002 > test_extractor
=> {:emails=>[#<AccountEmailAddress id: 114, account_id: nil, email_address: " cmlanger@gmail.com", email_type: "personal", created_at: "2011-08-15 20:19:22", updated_at: "2011-08-15 20:19:22">], :addresses=>{:origin=>#<Address id: 226, addressable_id: nil, addressable_type: nil, street_1: nil, street_2: nil, city: "Randolph", state: "Massachusetts", zip_code: "02368", floor: nil, latitude: nil, longitude: nil, status: "unverified", created_at: "2011-08-15 20:19:22", updated_at: "2011-08-15 20:19:22">}, :phones=>[#<AccountPhoneNumber id: 208, account_id: nil, number: "7322368849", phone_type: "home", created_at: "2011-08-15 20:19:22", updated_at: "2011-08-15 20:19:22">, #<AccountPhoneNumber id: nil, account_id: nil, number: nil, phone_type: "work", created_at: nil, updated_at: nil>], :first_name=>"Christine", :last_name=>"Langer", :contact_preference=>"No Preference Any Time", :move_date=>Thu, 06 Jan 2011, :move_weight=>"1 Bedroom, 2940 lbs"}
ruby-1.9.2-p180 :003 > ap _
#include <stdio.h>
#include <stdlib.h>
struct node{
void* data;
struct node* next;
};
void set_int_value(struct node* node, int val)
{