Skip to content

Instantly share code, notes, and snippets.

:shipit:
Git good yo!

Saurabh tkshnwesper

:shipit:
Git good yo!
Block or report user

Report or block tkshnwesper

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tkshnwesper
tkshnwesper / strshuffle.go
Last active Sep 21, 2016
String Shuffle in Go
View strshuffle.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 Nov 18, 2016
let's encrypt
View ssl
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';
View pollLast.java
while(!list.isEmpty()) {
String el = list.pollLast();
System.out.println(el);
}
/*
saurabh
is
name
my
View pollFirst.java
while(!list.isEmpty()) {
String el = list.pollFirst();
System.out.println(el);
}
/*
Hello
world
my
name
View pop.java
while(!list.isEmpty()) {
String el = list.pop();
System.out.println(el);
}
/*
Hello
world
my
name
View push.java
list.push("Hello");
list.push("world");
list.push("my");
list.push("name");
list.push("is");
list.push("saurabh");
for(String s : list) {
System.out.println(s);
}
View add.java
list.add("Hello");
list.add("world");
list.add("my");
list.add("name");
list.add("is");
list.add("saurabh");
for(String s : list) {
System.out.println(s);
}
View ll.java
LinkedList<String> list = new LinkedList<>();
View Incrementer.php
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 Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
You can’t perform that action at this time.