I hereby claim:
- I am umuro on github.
- I am umur (https://keybase.io/umur) on keybase.
- I have a public key ASCDmpjT3ec7yNc555RFep9wNlsAQp1XiUthgJ0B63AzuAo
To claim this, I am signing this object:
# kate: syntax ruby; | |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# IRB improvements: Command history, coloring, more shell like commands cd, pwd, dir, cat | |
# Use powerful shell commands | |
# dir | |
# dir '**/*.rb' | |
# cd 'app' | |
# pwd |
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
#[ -z "$PS1" ] && return | |
if [[ -n "$PS1" ]] ; then | |
# don't put duplicate lines in the history. See bash(1) for more options | |
export HISTCONTROL=ignoreboth |
# Regularly execute this to have a nice difference backup | |
# No Restore. Backups of different dates will be available as if normal folders. | |
# Just use them normally. | |
# On each backup the list of apt-get installed applications are dumped so that | |
# they can be restored simply. You don't wast space to backup the whole system. | |
echo Getting package selections | |
dpkg --get-selections >/home/packages.txt | |
TGT=/media/Elements-1 #!!!! Define your backup target here !!!! |
# kate: syntax ruby; | |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Add those comments to colorize non-rb files automatically. It happens that not all ruby files have the rb extension. |
# Usage example: rails new demo_blog -m template_umur_demo_blog.rb | |
# 2 points demonstrated | |
# - Templates are powerful. You can create even a working application | |
# - Ruby on Rails is very DRY. Code reads as if it's design | |
# Required gems | |
gem 'therubyracer', :platforms => :ruby, :group=>:assets #Rails need | |
gem 'inherited_resources' | |
gem 'has_scope' |
# kate: syntax ruby; | |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
require 'rubygems' | |
require 'thor' | |
class Gemset < Thor | |
include Thor::Actions |
# Creates a demo blog in a new hobo project | |
# Usage: rake rails:template LOCATION=template_demo_blog_hobo.rb | |
# Or: rake rails:template LOCATION=https://raw.github.com/gist/3405055/9aaac7c1c9e9571b32c4359fa9fff77c89de82a9/template_demo_blog_hobo.rb | |
say ("Installing gems so that we can scaffold...") | |
run 'bundle install' | |
generate 'hobo:setup_wizard' if yes? "Wanna run hobo:setup_wizard?" | |
generate 'hobo:resource', 'Post title:string text:text' |
#This bit goes at the end of rvmrc and makes sure that bundle is installed and it installs gems | |
#If you use bundler, this might be useful to you: | |
if [[ -s Gemfile ]] && { | |
! builtin command -v bundle >/dev/null || | |
builtin command -v bundle | grep $rvm_path/bin/bundle >/dev/null | |
} | |
then | |
printf "%b" "The rubygem 'bundler' is not installed. Installing it now.\n" | |
gem install bundler |
#Match a ruby metdhod using regex. To use Thor scripts to replace method definitions in existing source code. | |
# github: umuro, Umur Ozkul | |
def match_mtd(mtd) | |
/^\s*def (#{mtd})\s+((?!end).)*\s+end\s*$/m | |
end |
I hereby claim:
To claim this, I am signing this object: