Skip to content

Instantly share code, notes, and snippets.

@darkLord19
darkLord19 / README.md
Created November 9, 2020 13:30 — forked from roachhd/README.md
Basics of BrainFuck

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

BrainFuck Programming Tutorial by: Katie

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

INTRODUCTION

@darkLord19
darkLord19 / lfu.go
Last active October 28, 2020 06:25
LFU using ristretto
package cache
import (
"time"
"errors"
"github.com/tinylib/msgp/msgp"
"github.com/vmihailenco/msgpack/v5"
"github.com/dgraph-io/ristretto"
create new game:
localhost:8080/new?players_count=2&dimension=4
// this will return json with gameboard name
join game:
localhost:8080/join?roomname=weaselginger&username=uparmar&color=%FF1744
//color is hexadecimal color code. we accept only colors declared in constant package
// this will return json object with gameboard containing details about current turn and initial game board
play game:
int even_ones(unsigned x)
{
x ^= x>>16;
x ^= x>>8;
x ^= x>>4;
x ^= x>>2;
x ^= x>>1;
return !(x & 1);
}
# uparmar @ uparmar-mbp in ~/gosrc/src/cmd/go on git:master x [11:33:09]
$ cat diff.diff
diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go
index 2561f5b2f8..ebbead5d31 100644
--- a/src/cmd/go/alldocs.go
+++ b/src/cmd/go/alldocs.go
@@ -110,13 +110,11 @@
// The default is the number of CPUs available.
// -race
// enable data race detection.
@darkLord19
darkLord19 / gist:8dd5ff79803df99553bd33b783cd11df
Created September 26, 2019 08:38 — forked from khakimov/gist:3558086
Matrix Effect in you terminal
echo -e "\e[1;40m" ; clear ; while :; do echo $LINES $COLUMNS $(( $RANDOM % $COLUMNS)) $(( $RANDOM % 72 )) ;sleep 0.05; done|awk '{ letters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*()"; c=$4; letter=substr(letters,c,1);a[$3]=0;for (x in a) {o=a[x];a[x]=a[x]+1; printf "\033[%s;%sH\033[2;32m%s",o,x,letter; printf "\033[%s;%sH\033[1;37m%s\033[0;0H",a[x],x,letter;if (a[x] >= $1) { a[x]=0; } }}'
@darkLord19
darkLord19 / lifehacks.md
Last active July 16, 2019 12:47
REST endpoints for lifehacks api
info:
    title: Lifehacks
    description: API to hack your life!

object:
    image:
        id:     string
        height:     int
        width:      int
class Node:
def __init__(self, val):
self.data = val
self.next = None
class LinkedList:
def __init__(self):
self.head = None
def addNode(self, data):
https://c7049648-8093-4335-8687-3e18bb7c5db2.ws-ap0.gitpod.io
@darkLord19
darkLord19 / curl.md
Created May 21, 2019 17:53 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.