This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"fmt" | |
ico "github.com/Kodeworks/golang-image-ico" | |
"github.com/nfnt/resize" | |
"image" | |
"image/gif" | |
"image/png" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
func newT() T { | |
t := make(T) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class Observer<T> { | |
protected handlers: Array<(arg0: T) => void>; | |
constructor() { | |
this.handlers = new Array<(arg0: T) => void>(); | |
} | |
public subscribe(f: (arg0: T) => void) { | |
this.handlers.push(f) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* main.c - Control of Stepper Motor (28BYJ-48) via its driver | |
* written for ATMEGA-88A | |
* | |
* Created: 16.04.2020 19:00:00 | |
* Author : nils | |
*/ | |
#define F_CPU 8000000UL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
filename="first-names.txt" | |
targetFilename="names.txt" | |
wget https://raw.githubusercontent.com/dominictarr/random-name/master/${filename} | |
length=$(cat ${filename} | wc -l) | |
truncate -s 0 ${targetFilename} | |
for i in {1..42} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"flag" | |
"fmt" | |
"io" | |
"log" | |
"net" | |
"os" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package sshupload | |
import ( | |
"fmt" | |
"golang.org/x/crypto/ssh" | |
"io" | |
"net" | |
"os" | |
"path" | |
"path/filepath" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"net" | |
"time" | |
) | |
func main() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func logAccessInfo(addr string, port int, path, protocol string) { | |
ifaces, err := net.Interfaces() | |
if err != nil { | |
logrus.Infof("access it via %s://%s%s", protocol, addr, path) | |
} | |
for _, i := range ifaces { | |
addrs, err := i.Addrs() | |
if err != nil { | |
continue | |
} |