Skip to content

Instantly share code, notes, and snippets.

Avatar

Manuel A. Cerda espaciomore

View GitHub Profile
@espaciomore
espaciomore / watch.sh
Last active Oct 18, 2020
Watch command for Git Bash
View watch.sh
#!/bin/bash
ARGS="${@}"
clear;
while(true); do
OUTPUT=`$ARGS`
clear
echo -e "${OUTPUT[@]}"
done
@espaciomore
espaciomore / login.sh
Last active Mar 3, 2017
Login using Curl saving cookies file
View login.sh
#!/bin/bash
#TIMESTAMP=`date "+%Y%m%d_%H%M%S"`
FILTER="<title>"
REPLACEMENT="s/\s*<\/?title>\s*//g"
RESOURCE1=""
RESOURCE2=""
function get_cookie {
echo "POST $1/$RESOURCE1"
curl -d "$2" -H "Content-Type: application/x-www-form-urlencoded" -X POST "$1/$RESOURCE1" -s -c "cookie"
View pic.go
package main
import "golang.org/x/tour/pic"
func Pic(dx, dy int) [][]uint8 {
var p [][]uint8 = make([][]uint8, dy)
for i:=0;i<dy;i++ {
p[i] = make([]uint8, dx)
for j:=0;j<dx;j++ {
p[i][j] = uint8((j*i)/10)
@espaciomore
espaciomore / wordcount.go
Created Jan 1, 2017
Go Tour - Word Count
View wordcount.go
package main
import (
"golang.org/x/tour/wc"
"strings"
)
func WordCount(s string) map[string]int {
wordMap := make(map[string]int)
words := strings.Fields(s)
You can’t perform that action at this time.