Skip to content

Instantly share code, notes, and snippets.

@tkshnwesper
tkshnwesper / strshuffle.go
Last active September 21, 2016 15:14
String Shuffle in Go
// StrShuffle shuffles a string that is passed to it
func StrShuffle(str string) string {
n := 25 + rand.Intn(25)
var runes []rune
for _, runeval := range str {
runes = append(runes, runeval)
}
var shuffle = func() bool {
if rand.Intn(2) == 1 {
return true
@tkshnwesper
tkshnwesper / ssl
Last active November 18, 2016 17:02
let's encrypt
listen *:443 ssl http2;
listen [::]:443 ssl http2;
ssl_certificate /etc/letsencrypt/live/[site_name]/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/[site_name]/privkey.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers 'ECDH+AESGCM:ECDH+AES256:ECDH+AES128:DH+3DES:!ADH:!AECDH:!MD5';
LinkedList<String> list = new LinkedList<>();
@tkshnwesper
tkshnwesper / Incrementer.php
Last active August 29, 2015 14:23
Incrementer
function getIncrement($str) {
$len = strlen($str);
if($str === '') {
return '0';
}
for($i = $len - 1; $i >= 0; $i--) {
if($str[$i] === '9') {
$str[$i] = 'A';
break;
}
@tkshnwesper
tkshnwesper / 0_reuse_code.js
Last active August 29, 2015 14:21
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@tkshnwesper
tkshnwesper / loading-spin.svg
Last active August 29, 2015 14:21
Loading spin (SVG)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.