sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator
Terminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").
Sync Atom settings |
<?xml version="1.0" encoding="utf-8"?> | |
<truck_restrictions> | |
<selected_profile>Car EUROPE</selected_profile> | |
<set> | |
<name>Truck</name> | |
<vehicle_type>truck</vehicle_type> | |
<speed_limit>4294967295</speed_limit> | |
<optimization>fastest-transit</optimization> | |
<fuel>3</fuel> | |
<consumption_extra_urban>0.00000</consumption_extra_urban> |
Change titlebar height in Gnome | |
http://unix.stackexchange.com/questions/276951/how-to-change-the-titlebar-height-in-standard-gtk-apps-and-those-with-headerbars |
# Add these methods to your ApplicationController. Then, any controller | |
# that inherits from it will have these methods and can programmatically | |
# determine what filters it has set. | |
class ApplicationController < ActionController::Base | |
def self.filters(kind = nil) | |
all_filters = _process_action_callbacks | |
all_filters = all_filters.select{|f| f.kind == kind} if kind | |
all_filters.map(&:filter) | |
end |
# If you come from bash you might have to change your $PATH. | |
# export PATH=$HOME/bin:/usr/local/bin:$PATH | |
# Path to your oh-my-zsh installation. | |
export ZSH=/Users/marcoaraujo/.oh-my-zsh | |
# Set name of the theme to load. Optionally, if you set this to "random" | |
# it'll load a random theme each time that oh-my-zsh is loaded. | |
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes | |
# ZSH_THEME="robbyrussell" |
GET: | |
with JSON: | |
curl -i -H "Accept: application/json" -H "Content-Type: application/json" http://hostname/resource | |
as XML: | |
curl -H "Accept: application/xml" -H "Content-Type: application/xml" -X GET http://hostname/resource | |
curl -H "Accept: application/xml" "http://localhost:3040/api/org.xml" | |
curl -H "Accept: application/xml" -H "API_KEY: fgjfgjhfj68rvuIXy5XAlpRELmHKmOZNJeot62I3rePsnFAl15Wghjgs" "http://localhost:3040/api/org" |
require 'benchmark' | |
n = (10**6) | |
Benchmark.bm(7) do |x| | |
x.report("1:") do | |
1.upto(n) do | |
#code | |
end |
Here's a useful one - If you ever need to check the methods of a ruby class/module (e.g. Math or User) you can call public_methods
to get the class methods and public_instance_methods
to get the instance ones.
The problem with this is that you'll also get entries for everything that it inherits from too, all the way up to Object methods like is_a?
and send
To get around that, because they return arrays, you can subtract the result from calling it on the base class, e.g. Math.public_methods - Module.public_methods
, or User.instance_methods - ActiveRecord::Base.instance_methods
class MyLog | |
def self.debug(message=nil) | |
@my_log ||= Logger.new("#{Rails.root}/log/my.log") | |
@my_log.debug(message) unless message.nil? | |
end | |
end |