This file contains 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 | |
function usage { | |
echo Usage: $0 logfile.log logfile.log.1 [name] | |
exit | |
} | |
if [ -z $1 ]; then | |
usage | |
fi | |
if [ -z $2 ]; then |
This file contains 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 "os" | |
import "io/ioutil" | |
import "time" | |
type GPIO struct{} | |
func (r GPIO) Pin(name string) GPIO_Pin { | |
pin := GPIO_Pin{name} |
This file contains 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 | |
OUTPUT="/dev/shm/fakenet/"; | |
if [ ! -d "$OUTPUT" ]; then | |
mkdir -p $OUTPUT/{rpc,stat,ip_vs} | |
fi | |
SOURCES="/proc/net/dev | |
/proc/net/ip_vs_stats | |
/proc/net/ip_vs/stats |
This file contains 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
{{< tweet "Adding a \"Tweet this\" shortcode to Hugo, step-by-step tutorial" >}} |
This file contains 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 parse(input io.Reader) (p *point, err error) { | |
// handle read errors | |
read := func(data interface{}) { | |
if err == nil { | |
err = binary.Read(input, binary.BigEndian, data) | |
} | |
} | |
p := &point{} | |
read(&p.Longitude) |
This file contains 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 | |
if [ -z "$1" ]; then | |
echo "Usage: $0 [start/stop]" | |
exit 1 | |
fi | |
function setup_database { | |
NAME="$1" | |
DOCKERFILE="titpetric/percona-xtrabackup" | |
docker run -d -h $NAME --name $NAME --net=party -e MYSQL_ROOT_PASSWORD="testing" $DOCKERFILE |
This file contains 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 ( | |
"strings" | |
"testing" | |
) | |
func BenchmarkStringReverseBad(b *testing.B) { | |
b.ReportAllocs() |
This file contains 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
<blockquote class="tweet-this"> | |
<p><a href="http://twitter.com/intent/tweet?url={{ .Page.Permalink }}&text="{{ .Get 0 }}"&via=TitPetric" target="_blank">"{{ .Get 0 }}" via @TitPetric</a></p> | |
<a href="http://twitter.com/intent/tweet?url={{ .Page.Permalink }}&text="{{ .Get 0 }}"&via=TitPetric" target="_blank"><i class="fa fa-twitter"></i>Click to Tweet</a> | |
</blockquote> |
This file contains 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
{ | |
"require": { | |
"guzzlehttp/guzzle": "~6.0" | |
} | |
} |
This file contains 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
<?php | |
namespace AnimalDependencies; | |
trait Dog { | |
private $dog = false; | |
function setDog(\Animals\Dog $dog) { | |
$this->dog = $dog; | |
} | |
function getDog() { |
OlderNewer