(Several of these git examples have been extracted from the book 'Pragmatic guide to GIT' of Travis Swicegood )
git config --global user.name "Fernando Guillen"
git config --global user.email "fguillen.mail+spam@gmail.com"
cd /develop/myrepo
| #!/usr/bin/env ruby | |
| require 'benchmark' | |
| def method_1 | |
| `curl -s #{ARGV.first} | echo` | |
| end | |
| 10.times do |i| | |
| sleep 1 |
| require 'rubygems' | |
| gem 'rubyzip' | |
| require 'zip/zipfilesystem' | |
| require 'zip/zip' | |
| require 'dbi' | |
| ODBC_NAME='dbi:ODBC:visteam' | |
| # ODBC_NAME='dbi:ODBC:mypdm' | |
| USER_NAME='ReadOnly' |
| gem install rails aws-s3 deploy_kit hirb mime-types \ | |
| mislav-will_paginate mocha nifty-generators \ | |
| nokogiri passenger pog rack rake RedCloth \ | |
| rspec rspec-rails ruby-openid ruby_parser \ | |
| rubyzip spreadsheet uuid uuidtools --no-ri --no-rdoc |
| #!/bin/bash | |
| # Install Guide: | |
| # 1. Use http://www.virtualbox.org if you use Windows or OS X | |
| # 2. Download http://www.ubuntu.com 9.04 Desktop Edition and install into VM. | |
| # 3. In your ubuntu console: | |
| # $ wget http://gist.github.com/raw/180820/333b288a1b5df8df09842bfcfa248fa252f0cf3b/rails_install_script_on_ubuntu | |
| # $ chmod 555 rails_install_script_on_ubuntu | |
| # $ ./rails_install_script_on_ubuntu |
| Gems: | |
| gem 'cucumber' | |
| gem 'cucumber-rails' | |
| gem 'rspec' | |
| gem 'rspec-rails' | |
| gem 'capybara' | |
| gem 'database_cleaner' | |
| gem 'spork' | |
| gem 'watchr' |
| gem list | cut -d" " -f1 | xargs gem uninstall -aIx |
| local_filename = "create_file_name.rb" | |
| doc =<<'FILE' | |
| # This is a text for the file #{local_filename}. | |
| FILE | |
| File.open(local_filename, 'w+') {|f| f.write(doc) } |
| // From Dribbble.com | |
| // Keyboard shortcuts for browsing pages of lists | |
| // 使 WillPaginate 支持用左右键翻页 | |
| (function($) { | |
| $(document).keydown(handleKey); | |
| function handleKey(e){ | |
| var left_arrow = 37; | |
| var right_arrow = 39; | |
| if (e.target.localName == 'body' || e.target.localName == 'html') { |
| /* | |
| 12306 Auto Query => A javascript snippet to help you book tickets online. | |
| Copyright (C) 2011 Jingqin Lynn | |
| Includes jQuery | |
| Copyright 2011, John Resig | |
| Dual licensed under the MIT or GPL Version 2 licenses. | |
| http://jquery.org/license | |
| Includes Sizzle.js |