Skip to content

Instantly share code, notes, and snippets.

View vodrazka's full-sized avatar

Thomas vodrazka

View GitHub Profile
package main
import (
"fmt"
"reflect"
)
func main() {
var m Foo = MyStruct{"test"}
_ = m.DoSmth()
package main
import (
"net"
"log"
"bufio"
"os"
"fmt"
)
#!/bin/bash
while :
do
printf "$(date);$1\n"
sleep 2
done
func main() {
//ecs.Start(ecs.Configuration{FpsLimit: 30}, &MyScene{})
// Load a TXT file.
f, _ := os.Open("a")
defer f.Close()
// Create a new reader.
r := csv.NewReader(bufio.NewReader(f))
r.Comma = ';'
for {
import (
"fmt"
"github.com/fane89/gotron/ecs"
"github.com/fane89/gotron/ecs/systems"
"log"
"github.com/howeyc/fsnotify"
)
func main() {
#!/bin/bash
GOOS=linux GOARCH=arm GOARM=7 go build . && \
scp ${PWD##*/} pi@$1:~/bin/
server {
listen 80;
listen [::]:80;
server_name *.a.tech;
root /home/user/web;
location / {
}
}
@vodrazka
vodrazka / FireCommandWhenNewFileIsFree.go
Last active May 30, 2017 08:30
Watch for changes in local directory, if file is created start watching it. If file is not busy by other pids (except this programs process and fuser child process) fire given command with that new file as first argument.
package main
import (
"log"
"github.com/howeyc/fsnotify"
"path/filepath"
"os"
"flag"
"os/exec"
package main
import (
"bufio"
"os"
"io"
"log"
"fmt"
"flag"
"os/signal"
@vodrazka
vodrazka / .bash_profile
Last active March 14, 2019 09:25
.bash_profile
export VISUAL=vim
export EDITOR="$VISUAL"
export HISTCONTROL=ignoredups:erasedups
export HISTSIZE=10000
export PROMPT_COMMAND='history -a; history -r;echo -ne "\033]0;${PWD##*/}\007"'
green=$(tput setaf 2)
reset=$(tput sgr0)
PS1="\w \[$green\]$\[$reset\] "
stty -ixon