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
#!/usr/bin/env bash | |
bytesToHuman() { | |
b=${1:-0}; d=''; s=0; S=(Bytes {K,M,G,T,E,P,Y,Z}iB) | |
while ((b > 1024)); do | |
d="$(printf ".%02d" $((b % 1024 * 100 / 1024)))" | |
b=$((b / 1024)) | |
let s++ | |
done | |
echo "$b$d ${S[$s]} of space was cleaned up :3" |
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
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
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 ( | |
"fmt" | |
p "github.com/kr/pretty" | |
) | |
func main() { | |
type myType struct { | |
c []byte |
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 ( | |
"bytes" | |
"compress/gzip" | |
"io/ioutil" | |
) | |
type File struct { | |
path string |
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 "net" | |
// inspired by disqus.com/humans.txt | |
const bender = ` | |
.-. | |
( ) | |
'-' | |
J L |
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 ( | |
"sync" | |
"time" | |
) | |
func main() { | |
wg := new(sync.WaitGroup) | |
for _, i := range []int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10} { |
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 ( | |
"crypto/md5" | |
"crypto/sha1" | |
"encoding/hex" | |
"fmt" | |
"io" | |
) |
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 Shift(list []string) (string, []string) { | |
return list[0], list[1:len(list)] | |
} |
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
function childFind(selector, which) { | |
if (!this || !this.length) return $([]); | |
which = (which || 'previous') + 'Sibling'; | |
var element = this[0][which]; | |
while (element && (element.nodeType !== 1 || !$(element).is(selector))) element = element[which]; | |
return $(element); |
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 | |
# GITLAB | |
# Maintainer: @randx | |
# App Version: 2.9 | |
# from: https://raw.github.com/gitlabhq/gitlab-recipes/master/init.d/gitlab | |
### BEGIN INIT INFO | |
# Provides: gitlab | |
# Required-Start: $local_fs $remote_fs $network $syslog redis-server |
NewerOlder