Skip to content

Instantly share code, notes, and snippets.

View guiocavalcanti's full-sized avatar

Guilherme Cavalcanti guiocavalcanti

View GitHub Profile

Download and access the cluster

The linux kubectl binary can be fetched with a command like:

  curl -O https://storage.googleapis.com/kubernetes-release/release/v1.4.5/bin/linux/amd64/kubectl

On an OS X workstation, replace linux in the URL above with darwin:

Other name

To get started enter a title for your note above. When you’re ready to save your note just use Vim’s :write or :update commands, a filename will be picked automatically based on the title.

def method
   puts "foo"
end
{
"took":47,
"timed_out":false,
"_shards":{
"total":5,
"successful":5,
"failed":0
},
"hits":{
"total":159215,
class Representer < Representable::Decorator
include Representable::JSON
property :name, reader: lambda { |doc, args|
doc["full_name"] = doc["name"] + doc["surname"]
self.name = doc["name"]
}
property :surname
property :full_name
end

Use less +F instead of tail -f

Why? You can switch stream and search mode without leaving less. For example, while reading a file stream you can make a regular search by hitting Ctrl-c and using slash (/) to seek for a word. To switch back to stream mode hit F.

To see all the options available just read man less.

Reference: Stop using tail -f (mostly)

<!DOCTYPE html>
<html>
<head>
<title>Place Autocomplete</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<style>
html, body, #map-canvas {
height: 100%;
margin: 0px;

Often we need to use a gem from local file system while developing it. Bundle provides local gem overrides targeting this.

Assume my Gemfile is something like:

# Gemfile
gem 'fuelzee', git: 'git@github.com:Fuelzee/fuelzee-ruby.git'
  branch: 'master'
** [out :: staging.trustvox.com.br] Network error while fetching
** [out :: staging.trustvox.com.br] http://bb-m.rubygems.org/quick/Marshal.4.8/tzinfo-0.3.39.gemspec.rz
set noexpandtab " don't convert tabs into spaces
au! FileType haml set noet
" CoffeeScript
Bundle 'kchmck/vim-coffee-script'