Skip to content

Instantly share code, notes, and snippets.

View elstr's full-sized avatar
🍕
Working from home

Eleonora Lester elstr

🍕
Working from home
  • Buenos Aires
View GitHub Profile
@elstr
elstr / helpers.go
Created August 27, 2020 14:31
Go Test
package adnetwork
import (
"fmt"
"math"
"strings"
)
func SplitBids(bids []*Bid, size int) (chunks [][]*Bid) {
if len(bids) <= size {
@elstr
elstr / delete-minikube.md
Created August 11, 2020 14:55
delete minikube in mac

minikube stop; minikube delete && docker stop $(docker ps -aq) && rm -rf ~/.kube ~/.minikube && sudo rm -rf /usr/local/bin/localkube /usr/local/bin/minikube && launchctl stop 'kubelet.mount' && launchctl stop localkube.service && launchctl disable localkube.service && sudo rm -rf /etc/kubernetes/ && docker system prune -af --volumes

@elstr
elstr / add-p_flags.md
Last active August 10, 2020 16:18
git add -p flags

Flags of git add -p

Stage this hunk [y, n, q, a, d, /, j, J, g, s, e, ?]?
Here is a description of each option:

y stage this hunk for the next commit
n do not stage this hunk for the next commit
q quit; do not stage this hunk or any of the remaining hunks
a stage this hunk and all later hunks in the file
d do not stage this hunk or any of the later hunks in the file
@elstr
elstr / http_server.go
Created July 24, 2020 00:10
http server go
package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"strconv"
"strings"
)
@elstr
elstr / ejemplo-channels.go
Created July 20, 2020 21:12
codigo-clase-channels.go
package main
import (
"fmt"
"strings"
"sync"
"time"
)
func main() {
@elstr
elstr / colors.go
Created May 22, 2020 17:07
Terminal coloring golang
//General Formatting
#define GEN_FORMAT_RESET "0"
#define GEN_FORMAT_BRIGHT "1"
#define GEN_FORMAT_DIM "2"
#define GEN_FORMAT_UNDERSCORE "3"
#define GEN_FORMAT_BLINK "4"
#define GEN_FORMAT_REVERSE "5"
#define GEN_FORMAT_HIDDEN "6"
//Foreground Colors
@elstr
elstr / iterm2-oh-my-fish.md
Last active June 3, 2020 19:10 — forked from normanlolx/iterm2-oh-my-fish.md
iTerm2 Solarized Dark theme + Fish shell + oh-my-fish /// macOS High Sierra
@elstr
elstr / vim-heroku.sh
Created April 1, 2020 16:49 — forked from dvdbng/vim-heroku.sh
Run vim in heroku updated 2017
mkdir ~/vim
cd ~/vim
# Staically linked vim version compiled from https://github.com/ericpruitt/static-vim
# Compiled on Jul 20 2017
curl 'https://s3.amazonaws.com/bengoa/vim-static.tar.gz' | tar -xz
export VIMRUNTIME="$HOME/vim/runtime"
export PATH="$HOME/vim:$PATH"
cd -
@elstr
elstr / flat-my-array.js
Created January 16, 2020 13:50
Flat array with vanilla js
function flatMyArr(arr) {
return arr.reduce(function (acc, item) {
/* console.log("item", item)
console.log("acc", acc) */
if(Array.isArray(item)) flatMyArr(item)
return acc.concat(item)
}, [])
}
console.log(flatMyArr([1,2,[3],4]))