Skip to content

Instantly share code, notes, and snippets.

View erlinis's full-sized avatar
🇨🇴
Hola!

Erlinis Quintana erlinis

🇨🇴
Hola!
View GitHub Profile
@erlinis
erlinis / pull requests guide
Last active December 29, 2015 01:39
Guide to check/accept one pull requests
Step 1: Add a remote repository
$ git remote add <remote name> <url>
$ git remote add ricardo [email protected]:ricbermo/share.git
Sept 2: Fetch all the data (branchs) of remote repository
$ git fetch <remote name>
$ git fetch ricardo
* Command to list all the remote branch
@erlinis
erlinis / Update a forked project
Created November 22, 2013 14:42
In your local clone of your forked repository, you can add the original GitHub repository as a "remote". ("Remotes" are like nicknames for the URLs of repositories - origin is one, for example.) Then you can fetch all the branches from that upstream repository, and rebase your work to continue working on the upstream version. Taken form: http://…
Step 1:
# Add the remote, call it "upstream":
$ git remote add upstream git://github.com/whoever/whatever.git
Step 2:
# Fetch all the branches of that remote into remote-tracking branches, such as upstream/master:
$ git fetch upstream
Step 3:
# Make sure that you're on your master branch:
@erlinis
erlinis / Merge branch with master
Last active January 3, 2016 04:09
Mix changes from to branch to master
Using a new branch to merge changes
=========
Step 1:
# Create and swicth to hthe new branch
➜ skynet git:(master) git checkout -b ricardo_simple_form
Step 2:
# Copy master's changes into the new branch ('Ricardo Simple Form')
➜ skynet git:(ricardo_simple_form) git rebase master
@erlinis
erlinis / sublime-user-preferences.css
Last active August 29, 2015 13:56
Sublime user preferences
{
"color_scheme": "Packages/Color Scheme - Default/Monokai Bright.tmTheme",
"draw_white_space": "all",
"font_face": "monaco",
"font_size": 13.0,
"highlight_line": true,
"highlight_modified_tabs": true,
"ignored_packages":
[
"Vintage",
@erlinis
erlinis / TicTacToeGame.groovy
Last active August 29, 2015 14:09
TicTacToe Game
class TicTacToe {
private def rows = 3
private def cols = 3
private def board
private def currentPlayer
private def winner = ""
TicTacToe(firstPlayer="X"){
this.currentPlayer = firstPlayer
this.board = new Object[rows][cols]
// Initial Exercises:
def sum(xs: List[Int]): Int = {
def calculate(total :Int, xs: List[Int]) :Int = {
if(xs.isEmpty) total
else calculate((total + xs.head), xs.tail)
}
calculate(0,xs)
}
@erlinis
erlinis / scrapping_ipad_specs.rb
Created March 10, 2015 22:20
scrapping apple device specs
require 'mechanize'
agent = Mechanize.new
agent.get("http://www.everyi.com/by-identifier/ipod-iphone-ipad-specs-by-model-identifier.html")
items = agent.page.parser.css("#contentcenter>#contentcenter_specs_externalnav_wrapper")
ipad_spec = []
items.each do |item|
specs = item.search("#contentcenter_specs_externalnav_noflip_2>a").text
model = item.search("#contentcenter_specs_externalnav_noflip_3>a").text
ipad_spec.push({ model: model, specs: specs }) if (!model.empty?)
function MyString(text){
this.text = text;
this.length = function(){
var len = 0;
for (var iter in this.text){
len = len + 1;
}
return len;
};
Título: Como finalizar una llamada de alguién que te ofrece un servicio que no quieres adquirir
Vendedor: Buenos días señor(a) ...
Tú: ¿Me estas tratando de vender algo?
Vendedor: Más que vender, le estoy ofreciendo la posiblidad de adquirir un beneficio ....
Tú: Disculpa, disculpa que te interrumpa, al final voy a tener que pagar ¿cierto?
Vendedor: es solo un "mínima inversión" ....
Tú: Sí, si tengo que dar dinero,es un compra y no me interesa, gracias.
@erlinis
erlinis / point_fame.rb
Last active August 29, 2015 14:19
Script para jugar Punto y Fama contra la "máquina"
# Punto y fama
# Created by: Erlinis Quintana
# Date: April 19 2015
def print_instructions
puts """
Instructions: Type a four digits number, without repeat any digits,
until you guess the random number created by the computer.
After you entered the number you will get a hint, where:
1. Each 'F' (Fame) means than one number exists and is located in the right position.