Skip to content

Instantly share code, notes, and snippets.

View tors's full-sized avatar
:octocat:

Tors tors

:octocat:
  • Vim
View GitHub Profile
#!/usr/bin/env ruby
# SweDB XMLTV Grabber for EyeTV
# by Henrik Nyh <http://henrik.nyh.se> under the MIT License.
# Configure the list of channels below and run this script as a cron job, e.g.
# * */12 * * * ruby /path/to/this/script.rb
# to run it every 12 hours (suggested since cron jobs don't run if the computer is off).
# For more detailed instructions (in Swedish), see
# http://forums.elgato.com/viewtopic.php?f=86&t=1627&p=16279#p16420.
#!/bin/bash
#
# Find all the rails projects from this directory down and clear their log
# files to save some space.
#
base=`pwd`
for path in `find $base -type f -path '*/config/environment.rb'`
do
@tors
tors / example.conf
Created December 28, 2010 02:38 — forked from soffes/example.conf
server {
listen 80;
server_name example.com;
root /var/www/example.com/public;
#rails_env development;
passenger_enabled on;
charset utf-8;
}
# 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:
@tors
tors / .bashrc
Created February 22, 2011 01:44 — forked from julienXX/.bashrc
# Colors ----------------------------------------------------------
export TERM=xterm-color
export GREP_OPTIONS='--color=auto' GREP_COLOR='1;32'
export CLICOLOR=1
alias ls='ls -G' # OS-X SPECIFIC - the -G command in OS-X is for colors, in Linux it's no groups
#alias ls='ls --color=auto' # For linux, etc
//
// Backbone.Rails.js
//
// Makes Backbone.js play nicely with the default Rails setup, i.e.,
// no need to set
// ActiveRecord::Base.include_root_in_json = false
// and build all of your models directly from `params` rather than
// `params[:model]`.
//
// Load this file after backbone.js and before your application JS.
(function(){
window.JST = window.JST || {};
window.JST['discussions_collection'] = Haml('%h2 Foo:if 1 > 0 %h3 Bar');
})();
Home:harbonero(html) $ cap deploy:update
triggering start callbacks for `deploy:update'
* executing `multistage:ensure'
*** Defaulting to `demo'
* executing `demo'
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
executing locally: "git ls-remote git@binaries.unfuddle.com:binaries/harbornero.git html"
/Users/Home/.rvm/gems/ruby-1.8.7-p302@rails3/gems/capistrano-2.5.19/lib/capistrano/recipes/deploy.rb:98: warning: Insecure world writable dir /usr/local in PATH, mode 040777
// includes bindings for fetching/fetched
var PaginatedCollection = Backbone.Collection.extend({
initialize: function() {
_.bindAll(this, 'parse', 'url', 'pageInfo', 'nextPage', 'previousPage');
typeof(options) != 'undefined' || (options = {});
this.page = 1;
typeof(this.perPage) != 'undefined' || (this.perPage = 10);
},
fetch: function(options) {
# http://antonio.ognio.com/2010/07/28/installing-redis-on-linux-and-mac-os-x/
wget http://redis.googlecode.com/files/redis-2.2.2.tar.gz
tar -xzvf redis-2.2.2.tar.gz
cd redis-2.2.2 && sudo make && sudo make install
Five binaries will be installed to /usr/local/bin, redis-server, redis-benchmark, redis-cli, redis-check-dump and redis-check-aof. You’ll have to manually copy the Redis configuration file to /etc like this:
sudo mkdir /etc/redis
sudo cp redis.conf /etc/redis/redis.conf