Skip to content

Instantly share code, notes, and snippets.

View clsource's full-sized avatar
💻
🥷🏼

Camilo clsource

💻
🥷🏼
View GitHub Profile
@clsource
clsource / README.md
Created September 11, 2020 04:18
Two Number Sum

Code Challenge: Two Number Sum

Write a function that takes in a non empty array of distinct integers and an integer representing a target sum. If any two numbers in the input array sum up to the target sum, the function should return them in an array. If no two numbers sum up to the target sum, the function should return an empty array. Assume that there will be

Tests Cases

  • Sample input 1: [3,5,-4,8,11,1,-1,6], 10
@clsource
clsource / Commit Formatting.md
Created August 26, 2020 23:42 — forked from clemtibs/Commit Formatting.md
Angular Commit Format Reference Sheet

Commit Message Guidelines

We have very precise rules over how our git commit messages can be formatted. This leads to more readable messages that are easy to follow when looking through the project history. But also, we use the git commit messages to generate the Angular change log.

Commit Message Format

Each commit message consists of a header, a body and a footer. The header has a special format that includes a type, a scope and a subject:

@clsource
clsource / README.md
Last active August 16, 2020 00:07
Find the Outlier

Encuentra el 'outlier' de paridad

Dado un arreglo de enteros (con un mínimo de 3 elementos, pero puede ser bien grande), el cual está compuesto en su totalidad por números pares o impares, excepto por un elemento (el outlier), escriba un método que encuentre ese outlier.

Esta función debe ser implementada en JavaScript y no se pueden utilizar librerias externas. Completa la función en el archivo pregunta1.js.

Ejemplos:

[2, 4, 0, 100, 4, 11, 2602, 36]
Debería retornar: 11 (el único elemento impar)
@clsource
clsource / .editorconfig
Created August 9, 2020 20:49
Example of Makefiles in Windows
root = true
[*]
end_of_line = lf
insert_final_newline = true
indent_size = 2
indent_style = space
[Makefile]
indent_style = tab
@clsource
clsource / permutations-in-array.js
Last active July 21, 2020 21:46
A solution to a problem with permutations in array
/*
// Camilo Castro <camilo@ninjas.cl>
Problem:
Given a numeric array. find the cardinality of the set where substracting (absolute)
every number pair inside the set, results 1, 0 or less.
Example:
array = [ 1,1,2,2,4,4,5,5,5]
(() => {
const numbers = [0, 3, 5, 10, 15, 20, 25, 30];
const FIZZ = 3;
const FIZZ_WORD = "Fizz";
const BUZZ = 5;
const BUZZ_WORD = "Buzz";
const checkModuleIsZero = (numerator, denominator) => {
return numerator % denominator === 0;
};
@clsource
clsource / birds-chile.json
Last active July 5, 2020 03:34
Birds from Chile (Aves de Chile) JSON file extracted from buscaves.cl
[{"data":{"id":76,"uid":"76-buteo-albigula","map":{"svg":"http://www.buscaves.cl/images/svg.php?ave=76"},"image":{"url":"http://www.buscaves.cl/img/17082018024245aguilucho_chico_tomas_rivas_web.jpg","uri":"http://www.buscaves.cl/img/","filename":"17082018024245aguilucho_chico_tomas_rivas_web.jpg","name":"17082018024245aguilucho_chico_tomas_rivas_web","ext":"jpg"},"gallery":[{"url":"http://www.buscaves.cl/img/17082018024245aguilucho_chico_tomas_rivas_web.jpg","uri":"http://www.buscaves.cl/img/","filename":"17082018024245aguilucho_chico_tomas_rivas_web.jpg","name":"17082018024245aguilucho_chico_tomas_rivas_web","ext":"jpg"}],"names":{"spanish":"Aguilucho Chico","latin":"Buteo albigula","english":"White-throated Hawk"},"audio":{},"info":{"name":{"name":"Nombre en Inglés","key":"name","value":"White-throated Hawk"},"dimorfism":{"name":"Dimorfismo","key":"dimorfism","value":"No"},"migration":{"name":"Migratoria","key":"migration","value":"Sí"},"size":{"name":"Longitud","key":"size","value":"38 - 48 cm."},"geo":{"n
@clsource
clsource / SETUP-FISH-IN-MACOS.md
Created February 22, 2020 15:13
Setup Fish in MacOS

Install Homebrew

/usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install fish

@clsource
clsource / repo-reset.md
Created November 23, 2018 17:09 — forked from heiswayi/repo-reset.md
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A
@clsource
clsource / git-tag-delete-local-and-remote.sh
Created November 23, 2018 17:09 — forked from mobilemind/git-tag-delete-local-and-remote.sh
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName