- Some utilities:
sudo apt-get install vim tmux git
- Copy/paste from the command line:
sudo apt-get install xclip
# config/initializers/will_paginate.rb | |
module WillPaginate | |
module ActionView | |
def will_paginate(collection = nil, options = {}) | |
options[:renderer] ||= BootstrapLinkRenderer | |
super.try :html_safe | |
end | |
class BootstrapLinkRenderer < LinkRenderer |
#!/usr/bin/env ruby | |
# -*- coding: utf-8 -*- | |
# prints a sparkline in the terminal using the supplied list of numbers | |
# examples: | |
# spark.rb 10 20 30 100 90 80 | |
# spark.rb 1 2 0.4 0.1 1.3 0.7 | |
@ticks = %w[▁ ▂ ▃ ▄ ▅ ▆ ▇] | |
values = ARGV.map { |x| x.to_f } |
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
/.sass-cache | |
/public |
#!/bin/bash | |
MAILFILE=/tmp/mail.$$ | |
CURLFILE=/tmp/mail.$$.curl | |
cat > $MAILFILE | |
curl -i -F message=@$MAILFILE "http://localhost/incoming_messages" > $CURLFILE | |
if grep 'HTTP/1.1 204 No Content' $CURLFILE | |
then | |
rm -f $CURLFILE $MAILFILE | |
fi |
# 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 |
Researchers investigating the Rails parameter parsing vulnerability discovered that the same or similar vulnerable code had made its way into multiple other libraries. If your application uses these libraries to process untrusted data, it may still be vulnerable even if you have upgraded Rails. Check your Gemfile and Gemfile.lock for vulnerable versions of the following libraries.
Vulnerable: <= 3.2.10, <= 3.1.9, <= 3.0.18, <= 2.3.14
Fixed: 3.2.11, 3.1.10, 3.0.19, 2.3.15