Skip to content

Instantly share code, notes, and snippets.

View xpepper's full-sized avatar
💭
😏

Pietro Di Bello xpepper

💭
😏
View GitHub Profile
@xpepper
xpepper / pr.md
Created March 25, 2013 12:03 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@metalelf0
metalelf0 / gist:5361756
Created April 11, 2013 08:39
The FizzBuzz code from the latest Mikamai ruby academy.
class FizzBuzz
CONFIG = { 3 => "Fizz", 5 => "Buzz", 7 => "Bar" }
attr_reader :number
attr_accessor :string
def initialize number
@number = number
@string = ""
@iamatypeofwalrus
iamatypeofwalrus / generate_ctags.md
Last active February 11, 2019 10:17
Generate ctags for Atom (or for any other reason) on Mac os X

Why?

Atom can automagically picks up any tags file in your current directory which enables you to:

  • shift+cmd+r search for any function in your project
  • alt+cmd+down GoTo a function declaration

How

Get brew if you don't already have it. Then:

brew install ctags

@xpepper
xpepper / Sam Newman - Confusion In The Land Of The Serverless.md
Last active January 29, 2020 13:05
Notes from Sam Newman's talk "Confusion In The Land Of The Serverless" at CraftConf
@panthomakos
panthomakos / benchmark.rb
Created May 3, 2012 20:06
Benchmark Your Bundle
#!/usr/bin/env ruby
require 'benchmark'
REGEXPS = [
/^no such file to load -- (.+)$/i,
/^Missing \w+ (?:file\s*)?([^\s]+.rb)$/i,
/^Missing API definition file in (.+)$/i,
/^cannot load such file -- (.+)$/i,
]
@xpepper
xpepper / Keeping a branch up-to-date with master.md
Last active May 2, 2020 15:50
Keeping a branch up-to-date with master

Keeping a branch up-to-date with master and then merge back the branch to master

git checkout new-feature # Go to the feature branch named "new-feature"
git rebase master

# Now your feature have all the commits from master!
# this is because "git rebase master" reads like "git, please rebase my commits on top on the commits from master"