This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
wget http://download.jetbrains.com/ruby/RubyMine-5.4.3.tar.gz -O /tmp/rubymine | |
sudo tar -xzvf /tmp/rubymine -C /opt | |
sudo mv /opt/RubyMine-5.4.3.2.1 /opt/RubyMine | |
sudo cat >/usr/share/applications/jetbrains-rubymine.desktop <<EOF | |
[Desktop Entry] | |
Name=RubyMine | |
Comment=Integrated Development Environment | |
TryExec=/opt/RubyMine/bin/rubymine.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
First, I got a list of PHP-related install packages: | |
$ dpkg --get-selections | grep php | |
libapache2-mod-php5 install | |
php-apc install | |
php-pear install | |
php5 install | |
php5-cli install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ENV['MY_RUBY_HOME'] && ENV['MY_RUBY_HOME'].include?('rvm') | |
begin | |
rvm_path = File.dirname(File.dirname(ENV['MY_RUBY_HOME'])) | |
# rvm_lib_path = File.join(rvm_path, 'lib') | |
# $LOAD_PATH.unshift rvm_lib_path | |
require 'rvm' | |
RVM.use_from_path! File.dirname(File.dirname(__FILE__)) | |
rescue LoadError | |
raise "RVM ruby lib is currently unavailable." | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ActiveSupport | |
module PagedScope | |
def self.extended(base) | |
base.scope :paginated, lambda { |page,per_page| | |
page ||= 0 | |
per_page ||= 25 | |
base.limit( per_page.to_i ).offset( per_page.to_i * page.to_i ) | |
} | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Used to parse ActionScript style annotations | |
# [Annotation(key="value",foo="bar")] | |
# Where Annotation is the name and key and foo are attribute names. | |
# Quick string matching, does not create an "Annotation Object" | |
# for now, though that would be an improvement. | |
class AS3AnnotationParser | |
#Does the given annotation exist in the provided string? | |
def self.has_annotation (contents, name) | |
contents.match(/\[#{name}[^\]]?+\]/) != nil | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
After successful installation of the Apache 2 module, follow the next set of step to configure Apache. | |
Create the following two files in /etc/apache2/mods-available | |
sudo touch /etc/apache2/mods-available/passenger.load | |
paste following code in passenger.load file | |
LoadModule passenger_module /usr/lib/ruby/gems/1.9.2(your version)/gems | |
/passenger-3.0.2/ext/apache2/mod_passenger.so |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git log --diff-filter=D --summary | sed -n '/^commit/h;/\/some_dir\//{G;s/\ncommit \(.*\)/ \1/gp}' | |
delete mode 100644 blah/some_dir/file1 d3bfbbeba5b5c1da73c432cb3fb61990bdcf6f64 | |
delete mode 100644 blah/some_dir/file2 d3bfbbeba5b5c1da73c432cb3fb61990bdcf6f64 | |
delete mode 100644 blah/some_dir/file3 9c89b91d8df7c95c6043184154c476623414fcb7 | |
You'll get all files deleted from some_dir (see the sed command) together with the commit number in which it happen. Any sed regex will do (I use this to find deleted file types, etc) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ActionDispatch::Routing::Mapper | |
def draw(routes_name) | |
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb"))) | |
end | |
end | |
BCX::Application.routes.draw do | |
draw :api | |
draw :account | |
draw :session |