Skip to content

Instantly share code, notes, and snippets.

@bolilla
bolilla / capture.sh
Created September 13, 2019 12:35
Capture specific screen part on mac by pressing enter
while [ 1 ]; do
date=$(date "+%Y%m%dT%H%M%S")
screencapture -x -R35,75,1366,768 ~/screenshots/"screen_${date}.png"
read
done
@bolilla
bolilla / .sh
Created October 22, 2017 21:02
Monitor list of docker containers
#/bin/bash
while true; do output=$(docker ps -a); clear; echo "$output"; sleep 1; done
@bolilla
bolilla / download-dw-rss.go
Created April 4, 2016 22:04
Scrap Desche Welle german course called "audioinstructor" located in "http://www.dw.com/search/es/audioinstructor/category/4639/". Gets MP3 and PDF files
package main
// This code downloads all the PDF and audios from DW german course in the
// following URL: http://rss.dw.com/xml/DKpodcast_audiotrainer_es
import (
"fmt"
rss "github.com/jteeuwen/go-pkg-rss"
"github.com/kennygrant/sanitize"
"github.com/yhat/scrape"
@bolilla
bolilla / Ldif2Csv.go
Created July 3, 2015 20:11
LDIF file to CSV
//Reads a LDIF file and writes a tab-separated file with the given fields
package main
import (
"bufio"
"fmt"
"os"
"sort"
"strings"
@bolilla
bolilla / echoTdp.go
Created June 29, 2015 06:32
Echo TCP Go
//Creates a TCP server that echoes whatever it receives
//In order to check it, you have to run this program,
//connect via telnet to port 50000 and send some keystrokes
package main
import (
"fmt"
"net"
)
@bolilla
bolilla / GoPadawan CompoInterfaces Test.go
Created June 8, 2015 06:56
GoPadawan CompoInterfaces Test
package main
import "fmt"
type motor struct {
ruido string
}
func (m motor) hacerRuido() string {
return fmt.Sprintf("Este motor hace: %s", m.ruido)
@bolilla
bolilla / GoPadawan CompoInterfaces Composicion.go
Created June 8, 2015 06:55
GoPadawan CompoInterfaces Composicion
package main
import "fmt"
type motor struct {
ruido string
}
func (n motor) hacerRuido() string {
return fmt.Sprintf("Este motor hace: %s", n.ruido)
@bolilla
bolilla / GoPadawan CompoInterfaces Interfaz.go
Created June 8, 2015 06:54
GoPadawan CompoInterfaces Interfaz
package main
import "fmt"
type motor struct {
ruido string
}
func (n motor) hacerRuido() string {
return fmt.Sprintf("Este motor hace: %s", n.ruido)
@bolilla
bolilla / GoPadawan Composición.go
Created May 30, 2015 11:42
GoPadawan Composición
package main
import "fmt"
type empuñadura string
func (e empuñadura) describe() string {
return fmt.Sprintf("La empuñadura es de '%s'", e)
}
@bolilla
bolilla / GoPadawan Composición sencilla.go
Created May 30, 2015 11:40
GoPadawan Composición sencilla
package main
import "fmt"
type empuñadura string
func (e empuñadura) describe() string {
return fmt.Sprintf("La empuñadura es de '%s'", e)
}