Installs ruby-2.0.0-p0 on ubuntu via checkinstall so it's in your package manager and you can remove it.
Quick install:
curl -Lo- https://gist.github.com/Sfate/5535586/raw/install-ruby-2-ubuntu.sh | bash| #Model | |
| @user.should have(1).error_on(:username) # Checks whether there is an error in username | |
| @user.errors[:username].should include("can't be blank") # check for the error message | |
| #Rendering | |
| response.should render_template(:index) | |
| #Redirecting | |
| response.should redirect_to(movies_path) |
| # Ways to execute a shell script in Ruby | |
| # Example Script - Joseph Pecoraro | |
| cmd = "echo 'hi'" # Sample string that can be used | |
| # 1. Kernel#` - commonly called backticks - `cmd` | |
| # This is like many other languages, including bash, PHP, and Perl | |
| # Returns the result of the shell command | |
| # Docs: http://ruby-doc.org/core/classes/Kernel.html#M001111 |
| # encoding: UTF-8 | |
| Capistrano::Configuration.instance(:must_exist).load do | |
| namespace :rails do | |
| desc "Open the rails console on one of the remote servers" | |
| task :console, :roles => :app do | |
| hostname = find_servers_for_task(current_task).first | |
| exec "ssh -l #{user} #{hostname} -t 'source ~/.profile && #{current_path}/script/rails c #{rails_env}'" | |
| end | |
| end |
| var playSingleChime = function() | |
| { | |
| var context = new webkitAudioContext(), | |
| gain = context.createGainNode(), | |
| osc = context.createOscillator(); | |
| osc.connect(gain); | |
| gain.connect(context.destination); | |
| osc.frequency.value = 1000.0; |
| # Script for installing tmux 1.7 | |
| # | |
| # Installation: | |
| # $ curl -Lo- http://git.io/tmux-1.7_install.sh | bash | |
| # Find me here: | |
| # https://gist.github.com/4510955 | |
| # exit on error | |
| set -e |
Installs ruby-2.0.0-p0 on ubuntu via checkinstall so it's in your package manager and you can remove it.
Quick install:
curl -Lo- https://gist.github.com/Sfate/5535586/raw/install-ruby-2-ubuntu.sh | bash| var $ = function (d) { | |
| var $ = document.querySelectorAll.bind(document); | |
| Element.prototype.on = Element.prototype.addEventListener; | |
| NodeList.prototype.on = function (event, fn) { | |
| [].forEach.call(this, function (el) { | |
| el.on(event, fn, false); | |
| }); | |
| }; | |
| # Generate Private Key | |
| $ openssl genrsa -out server.key 2048 | |
| # Generate CSR | |
| $ openssl req -new -out server.csr -key server.key -config openssl.cnf | |
| # => Fill in info | |
| # Check CSR | |
| $ openssl req -text -noout -in server.csr | |
| # Sign Cert | |
| $ openssl x509 -req -days 3650 -in server.csr -signkey server.key -out server.crt -extensions v3_req -extfile openssl.cnf |
I'm in a hospital in Spain and my MacBook was stolen.
Now I bought a new one and need to configure it. I have an external hard drive that backup everything using Time Machine, but I don't want all the crap I had in the old one.
| function whatDoesItDo(val){ | |
| return val ? 1 : 2; | |
| } |