Skip to content

Instantly share code, notes, and snippets.

View highercomve's full-sized avatar
🏠
Working from home for Pantacor 👍

Sergio Marin highercomve

🏠
Working from home for Pantacor 👍
View GitHub Profile
@highercomve
highercomve / genymotionwithplay.txt
Created March 30, 2016 19:56 — forked from wbroek/genymotionwithplay.txt
Genymotion with Google Play Services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
Google Apps for Android 4.4.4 (https://www.androidfilehost.com/?fid=23501681358544845 - gapps-kk-20140606-signed.zip)
Google Apps for Android 4.3 (https://www.androidfilehost.com/?fid=23060877490000124 - gapps-jb-20130813-signed.zip)
@highercomve
highercomve / other_type_of_permutation.js
Created December 10, 2015 06:53
JS Array permutation
function permute(arr) {
if (arr.length === 2) {
return [arr.slice(), arr.slice().reverse()]
}
return arr.map(function(element, index, array) {
var new_array = array.slice()
var last_element = new_array.splice(index, 1)
return permute(new_array).map(function(x) {
return last_element.concat(x)

A zero-indexed array A consisting of N integers is given. An equilibrium index of this array is any integer P such that 0 ≤ P < N and the sum of elements of lower indices is equal to the sum of elements of higher indices, i.e. A[0] + A[1] + ... + A[P−1] = A[P+1] + ... + A[N−2] + A[N−1]. Sum of zero elements is assumed to be equal to 0. This can happen if P = 0 or if P = N−1.

For example, consider the following array A consisting of N = 8 elements:

A[0] = -1 A[1] = 3 A[2] = -4 A[3] = 5

testing same problem speed

Take and array and remove the first element, keep the next one, remove the third and continue in that way until you have only one element in the array, example:

start with [1,2,3,4,5,6]

remove 1, keep 2, remove 3, keep 4, remove 5, keep 6, remove 2, keep 4, remove 6, then return 4.

  • remover [1,2,3] => 2
  • remover [1,2,3,4] => 4
const _tap = function _tap(input) {
return new Tap(input);
}
class Tap {
constructor(value) {
this.value = value
}
valueOf () {
return this.value
@highercomve
highercomve / creatable.js
Last active November 7, 2015 17:34
componer un factory
export default function Creatable (url, type, $http, $q) {
return function(Obj) {
var deferred = $q.defer()
$http({
method: 'POST',
url: `${url}`,
data: {
data: {
type: type,
attributes: Obj
@highercomve
highercomve / list_by_commiter.sh
Last active September 3, 2015 21:48 — forked from GusGA/list_by_commiter.sh
lines_by_commiter
git log --numstat --pretty="%H" --author=$1 | grep -v "public/" | awk 'NF==3 {plus+=$1; minus+=$2} END {printf("+%d, -%d\n", plus, minus)}'
@highercomve
highercomve / clean.sh
Last active January 28, 2016 21:13
Clean Dockers
sudo docker ps -a | awk '{print $1}' | grep -v CONTAINER | xargs sudo docker rm
sudo docker images | grep "<none>" | awk '{print $3}' | xargs sudo docker rmi

Keybase proof

I hereby claim:

  • I am highercomve on github.
  • I am highercomve (https://keybase.io/highercomve) on keybase.
  • I have a public key ASAnsujY4rQYdPWd3BTwwIJe741absr1BKULUdO6mqEBBwo

To claim this, I am signing this object:

@highercomve
highercomve / tmux.conf
Created January 8, 2015 18:43
Configuración de Tmux
set -g mode-mouse on
set -g mouse-resize-pane on
set -g mouse-select-pane on
set -g mouse-select-window on
# Toggle mouse on with ^B m
bind m \
set -g mode-mouse on \;\
set -g mouse-resize-pane on \;\
set -g mouse-select-pane on \;\