Skip to content

Instantly share code, notes, and snippets.

View ctrochalakis's full-sized avatar

Christos Trochalakis ctrochalakis

View GitHub Profile
@ctrochalakis
ctrochalakis / watcher.coffee
Created April 30, 2010 12:35
Watching and compiling coffee scripts
# Coffe Blender for your coffee scripts
# It watches coffee for changes and compiles
# ======
# coffee --no-wrap -c watcher.coffee # Compile it, onetime
#
# Now you can eiher supply the files from the command line:
# node watcher.js my_file.coffee
# or pass them through stdin:
# find . | grep coffee$| node watcher.js -
# git ls-files | grep coffee$| node watcher.js -
= Ruby Packaging Standard
The aim of this document is to specify a common structure of how a
Ruby package distributed as source (that is, but not limited to,
development directories, version-controlled repositories, .tar.gz,
Gems, ...) should conform to.
(See RFC 2119 for use of MUST, SHOULD, SHALL.)
== Library files
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
# - a browser with WebSocket support
#
# Usage:
# ruby redis_pubsub_demo.rb
#

GitHub Javascript Strategy

Unless otherwise necessary (such as mobile development), the GitHub javascript codebase is based off jQuery. You can safely assume it will be included on every page.

File naming

  • All jquery plugins should be prefixed with jquery, such as jquery.facebox
  • All github-specific jquery plugins should be prefixed with jquery.github. Like jquery.github.repo_list.js
  • All page-specific files (that only run on ONE page) should be prefixed with page. page.billing.js
@ctrochalakis
ctrochalakis / Gemfile
Created February 19, 2010 19:25 — forked from indirect/Gemfile
# include at least one source and the rails gem
source :gemcutter
gem "rails", "~> 2.3.5", :require => nil
gem "sqlite3-ruby", :require => "sqlite3"
# Devise 1.0.2 is not a valid gem plugin for Rails, so use git until 1.0.3
# gem "devise", :git => "git://github.com/plataformatec/devise.git", :ref => "v1.0"
group :development do
# bundler requires these gems in development
# Basic text search with relevancy for MongoDB.
# See http://blog.tty.nl/2010/02/08/simple-ranked-text-search-for-mongodb/
# Copythingie 2010 - Ward Bekker - [email protected]
#create (or empty) a docs collection
doc_col = MongoMapper.connection.db('example_db').collection('docs')
doc_col.remove({})
#add some sample data
doc_col.insert({ "txt" => "it is what it is"})
module Resque
module Failure
# Store a copy of the failure in Redis, so we have access from the UI. Also
# send an email to the developer, so we know something went foul.
class Notifier < Base
def save
# Store in Redis
super
# Create notification email
email = TMail::Mail.new
# See also http://github.com/simonjefford/rack_firebug_logger
# for this middleware + tests + a rails plugin
class FirebugLogger
def initialize(app, options = {})
@app = app
@options = options
end
def call(env)
dup._call(env)
#!/usr/bin/env python
#
# Copyright (c) 2010 Giorgos Keramidas.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.