Skip to content

Instantly share code, notes, and snippets.

View bcambel's full-sized avatar
🌴
On vacation

Bahadir Cambel bcambel

🌴
On vacation
View GitHub Profile
@bcambel
bcambel / redis-server
Created September 19, 2011 11:36 — forked from timols/redis-server
Init.d Redis script for Ubuntu
#! /bin/sh
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $syslog
# Required-Stop: $syslog
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redis-server - Persistent key-value db
@bcambel
bcambel / Capistrano-Deployment-Recipe.rb
Created September 19, 2011 20:27 — forked from mrrooijen/Capistrano-Deployment-Recipe.rb
a "base" Capistrano Rails Deployment Recipe. Use it to deploy your Rails application. It is also easily expandable. So feel free to grab this Recipe and add your own tasks/customization!
# Guide
# Configure the essential configurations below and do the following:
#
# Repository Creation:
# cap deploy:repository:create
# git add .
# git commit -am "initial commit"
# git push origin master
#
# Initial Deployment:
@bcambel
bcambel / full.plugin.list.txt
Created October 12, 2011 19:22 — forked from briandoll/full.plugin.list.txt
Full Plugin List Deployed in applications monitored by New Relic, September 2011
Full Plugin List Deployed in Rails applications monitored by New Relic, September 2011
Count Plugin Name
-------------------
2040 rpm
1534 newrelic_rpm
1268 acts_as_list
1186 paperclip
1130 will_paginate
1068 exception_notification
@bcambel
bcambel / crunchbase-api-v1.md
Created November 3, 2011 14:37 — forked from dominicsayers/crunchbase-api-v1.md
CrunchBase API v1

NOTE: This documentation has been put here because I couldn't find it anywhere else. I am not associated with Crunchbase in any way. I cannot help you with your Crunchbase API problems. If you need help try here: https://groups.google.com/forum/#!forum/crunchbase-api

CrunchBase API v1 Documentation

Overview

The CrunchBase API provides JSON representations of the data found on CrunchBase. The API currently supports three actions: "show", "search", and "list", which are each described below.

@bcambel
bcambel / README.md
Created November 10, 2011 10:45 — forked from mloughran/README.md

Getting started

First add your twitter username and password. Then server.rb and once it's started open websocket.html in your browser. You should see some tweets appear. If not take a look at the javascript console.

# coding:utf-8
$:.unshift(File.join(File.dirname(__FILE__), 'lib'))
require 'rubygems'
require 'active_record'
require 'em-mysqlplus'
require 'em-synchrony'
require 'em-activerecord'
db_config = YAML.load_file(File.join(File.dirname(__FILE__), 'config', 'database.yml'))
@bcambel
bcambel / mongo_pubsub.rb
Created November 16, 2011 14:08 — forked from octplane/mongo_pubsub.rb
Simple Pub/Sub system using MongoDB, capped collections and tailable cursors in ruby
require 'rubygems'
require 'mongo'
module MongoPubSub
QUEUES_COLLECTION = 'queues'
class EndSubscriptionException < Exception; end
class Publisher
def initialize(queue_name, mongo_connection)
# Initialize queue collection as a capped collection
if not mongo_connection[QUEUES_COLLECTION].collection_names.include?(queue_name)
@bcambel
bcambel / gist:1537176
Created December 30, 2011 01:39 — forked from joerussbowman/gist:1176002
Tornado Twitter Stream
# not pretty, I quickly moved to another idea
# not involving the Twitter stream. Good starting
# point.
import re
import base64
import socket
import asyncmongo
from tornado import ioloop
from tornado import iostream
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
@bcambel
bcambel / node-reader.js
Created April 4, 2012 18:49 — forked from dongyuwei/node-reader.js
google reader api for nodejs
/*
This library was developed by Will Honey.
It is licensed under the GPLv3 Open Source License
This library requires the underscore library found at http://documentcloud.github.com/underscore/
This library requires the underscore string library found at http://edtsech.github.com/underscore.string/
This library requires the support of localStorage. Updates could be easily made to change that.
*/
/* jslint adsafe: false, devel: true, regexp: true, browser: true, vars: true, nomen: true, maxerr: 50, indent: 4 */