Skip to content

Instantly share code, notes, and snippets.

View shenoudab's full-sized avatar

Shenouda Bertel shenoudab

View GitHub Profile
#!/bin/bash
VERSION="1.1"
REEV="http://rubyforge.org/frs/download.php/48623/ruby-enterprise-1.8.6-20081215.tar.gz"
REEF="ruby-enterprise-1.8.6-20081215.tar.gz"
REEFF=${REEF%".tar.gz"}
PASSENGER="2.0.6"
echo "#####################################"
echo "Welcome, let's get this party rollin'"
echo "#####################################"
#!/usr/bin/env ruby
require 'rubygems'
require 'octopi'
require 'choice'
include Octopi
Choice.options do
header ''
Rails CMS alternatives
======================
Active projects:
---------------
adva-cms
repo: http://github.com/svenfuchs/adva_cms/
site: http://adva-cms.org/
Last update: 11/24/09
"the cutting edge Rails CMS platform"
class Cart
include MongoMapper::Document
many :cart_items
timestamps!
def add_new_item_or_increase_quantity(product_id, quantity)
if self.has_product?(product_id)
self.increment_cart_item_quantity(product_id, quantity)
else
#!/usr/bin/ruby
require "rubygems"
require "mongo"
require "json/pure"
require "open-uri"
# db config
db = Mongo::Connection.new.db('friendfeed')
col = db.collection('lifesci')
{
"name": "NokiaN70",
"brand": "Nokia",
"model": "N70",
"user-agent": ["NokiaN70-1","NokiaN70-2","NokiaN70-3"],
"css": {
"css_supports_width_as_percentage": true
},
"sms": {
"callericon": true,
require 'rubygems'
require 'eventmachine'
require 'em-websocket'
require 'json'
class Connection
attr_accessor :socket, :user_id
def initialize(socket, user_id)
@socket = socket
model_object.copy_to_db(CouchRest.database!("http://admin:[email protected]:5984/db")
# couchrest/document
def copy_to_db(db, bulk = false)
raise ArgumentError, "doc.database required to copy" unless db
#result = db.copy_doc(self, dest)
result = db.save_doc self, bulk
result['ok']
end
@shenoudab
shenoudab / templates layouts
Created November 4, 2010 14:52
templates and layouts conflict
layout :layout_by_resource
theme :layout_by_resource
def layout_by_resource
if devise_controller?
if resource_name == :participant
if subdomain_conference && user_signed_in?
"conf_manage"
elsif subdomain_conference && participant_signed_in?
"conf_participant"
@shenoudab
shenoudab / pip.log
Created January 2, 2012 09:37
vumi installation log
Requirement already satisfied (use --upgrade to upgrade): zope.interface in ./ve/lib/python2.7/site-packages (from -r config/requirements.pip (line 1))
Requirement already satisfied (use --upgrade to upgrade): carrot==0.10.4 in ./ve/lib/python2.7/site-packages (from -r config/requirements.pip (line 2))
Requirement already satisfied (use --upgrade to upgrade): celery==1.0.6 in ./ve/lib/python2.7/site-packages (from -r config/requirements.pip (line 3))
Requirement already satisfied (use --upgrade to upgrade): twisted==10.1 in ./ve/lib/python2.7/site-packages (from -r config/requirements.pip (line 4))
Requirement already satisfied (use --upgrade to upgrade): txamqp==0.5 in ./ve/lib/python2.7/site-packages (from -r config/requirements.pip (line 5))
Requirement already satisfied (use --upgrade to upgrade): Django==1.3 in ./ve/lib/python2.7/site-packages (from -r config/requirements.pip (line 6))
Requirement already satisfied (use --upgrade to upgrade): PyYAML==3.09 in ./ve/lib/python2.7/site-packages (from -r conf