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 / articulo_github.md
Last active April 23, 2024 23:19
10 razones para usar Github

10 razones para usar Github

Si eres desarrollador o desarrolladora y aún no conoces que es Github ni Git, a continuación te lo explicaré y te daré 10 razones por las cuales después de leer este articulo correrás abrir una cuenta.

En primer lugar hay que mencionar que Git es un sistema de control de versiones distribuido, gratis, open source, rápido y eficiente y Github es una plataforma web para alojar repositorios de código usando el sistema de Git.

1. Versionar tu código.

Esto quiere decir guardar en determinado momento los cambios efectuados a un archivo o conjunto de archivos, con la oportunidad que tener acceso a ese historial de cambios, ya sea para regresar a una de esas versiones o para hacer comparaciones entre ellas. En este punto hay que destacar las ventajas frente a herramientas como Subversion y Perforce; que son usadas para este mismo fin, la principal es que no necesitarías montar, mantener, hacer

@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.
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.
function MyString(text){
this.text = text;
this.length = function(){
var len = 0;
for (var iter in this.text){
len = len + 1;
}
return len;
};
@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?)
// 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 / 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]
@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 / 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 / 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: