Skip to content

Instantly share code, notes, and snippets.

View rajeshkp's full-sized avatar

Rajesh Koilpillai rajeshkp

View GitHub Profile
@igorsokolov
igorsokolov / transporter_chief.rb
Created July 12, 2012 07:19
Transporter Chief - upload iOS application to iOS devices
#!/usr/bin/ruby
require 'optparse'
require 'ostruct'
require 'fileutils'
require 'pathname'
require 'tmpdir'
$script_path = File.expand_path(File.dirname(__FILE__))
$temp_path = Dir.mktmpdir
@peter
peter / creating-edgerails-app.sh
Created June 30, 2012 21:03
Creating and Deploying an EdgeRails (Rails 4) Application to Heroku
# 0. Make sure you have Ruby 1.9.3 installed, and optionally RVM and PostgreSQL
# 0.2 If you are on the Mac, make sure you have a c compiler by installing XCode Command Line Tools or gcc4.2 with homebrew
# https://github.com/mxcl/homebrew/wiki/Custom-GCC-and-cross-compilers
# 0.5 Make sure you have bundler version ~> 1.2 as Rails depends on it
gem install bundler
# 1. Get edge Rails source (master branch)
git clone https://github.com/rails/rails.git
@mlangenberg
mlangenberg / deploy.rb
Created June 25, 2012 13:27
Capistrano task to download all application log files (including logrotated)
namespace :log do
desc "Downloads application logs to ./log/deploy/<RAILS_ENV>/<TIMESTAMP>/"
task :fetch, :roles => :app do
source = "#{shared_path}/log/#{rails_env}.log*"
files_per_host = {}
run "ls #{source}" do |channel, stream, data|
files_per_host[channel[:host]] = data.split("\n")
end
destination = File.join('log', 'deploy')
@bradhe
bradhe / redis.rake
Created June 14, 2012 16:50
Rake task for managing Redis, including connecting via CLI in current enviro.
require 'open3'
namespace :redis do
task :cli do
redis_config = File.expand_path('../../../config/redis.yml', __FILE__)
config_data = YAML.load_file(redis_config)
uri = URI.parse(config_data[ENV['RAILS_ENV'] || 'development'])
cli = File.expand_path('/path/to/redis-cli', __FILE__)
set :max_asset_age, 2 ## Set asset age in minutes to test modified date against.
after "deploy:finalize_update", "deploy:assets:determine_modified_assets", "deploy:assets:conditionally_precompile"
namespace :deploy do
namespace :assets do
desc "Figure out modified assets."
task :determine_modified_assets, :roles => assets_role, :except => { :no_release => true } do
set :updated_assets, capture("find #{latest_release}/app/assets -type d -name .git -prune -o -mmin -#{max_asset_age} -type f -print", :except => { :no_release => true }).split
@dstroot
dstroot / install-redis.sh
Created May 23, 2012 17:56
Install Redis on Amazon EC2 AMI
#!/bin/bash
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server
###############################################
# To use:
# wget https://raw.github.com/gist/2776679/04ca3bbb9f085b192f6aca945120fe12d59f15f9/install-redis.sh
# chmod 777 install-redis.sh
# ./install-redis.sh
###############################################
echo "*****************************************"
@robotmay
robotmay / application_controller.rb
Created May 16, 2012 11:12
Examples of low level caching
class ApplicationController < ActionController::Base
protect_from_forgery
before_filter do
@categories = Rails.cache.fetch("global/categories", expires_in: 10.minutes) do
Category.where("posts_count > 0").all
end
end
end
@paulmillr
paulmillr / active.md
Last active May 15, 2025 11:20
Most active GitHub users (by contributions). https://paulmillr.com

Most active GitHub users (git.io/top)

The list would not be updated for now. Don't write comments.

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Wed, 21 Sep 2022 till Thu, 21 Sep 2023.

Because of GitHub search limitations, only 1000 first users according to amount of followers are included. If you are not in the list you don't have enough followers. See raw data and source code. Algorithm in pseudocode:

githubUsers
@macdonst
macdonst / imei.js
Created April 20, 2012 15:04
IMEI Plugin for PhoneGap 1.4.1
var IMEI = function(){};
IMEI.prototype.get = function(onSuccess, onFail){
return PhoneGap.exec(onSuccess, onFail, 'IMEI', 'get', []);
};
PhoneGap.addConstructor(function(){
PhoneGap.addPlugin('imei', new IMEI());
});
@sowawa
sowawa / memcached
Created April 2, 2012 04:28
memcached start/stop script for rackhub
#! /bin/sh
#
# chkconfig: - 55 45
# description: The memcached daemon is a network memory cache service.
# processname: memcached
# config: /etc/sysconfig/memcached
# Source function library.
# . /etc/rc.d/init.d/functions