Skip to content

Instantly share code, notes, and snippets.

View nanoninja's full-sized avatar

Vincent Letourneau nanoninja

View GitHub Profile
@nanoninja
nanoninja / ubuntu_install.sh
Created December 11, 2016 16:39
Ubuntu Deb Installation
#!/bin/bash
# URLS
URL_DOCKER="deb https://apt.dockerproject.org/repo ubuntu-xenial main"
URL_GOLANG="https://storage.googleapis.com/golang/go1.7.4.linux-amd64.tar.gz"
URL_MONGODB="https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1604-3.4.0.tgz"
URL_NETBEANS="http://download.netbeans.org/netbeans/8.2/final/bundles/netbeans-8.2-php-linux-x64.sh"
# Upgrade and install
add-apt-repository -y ppa:numix/ppa
@nanoninja
nanoninja / scores.js
Created November 14, 2016 14:22
MongoDB random dataset of scores
/**
* MongoDB fixtures
*
* Command: mongo dbname scores.js
*/
var names = ["exam", "essay", "quiz"];
for (var i = 0; i < 1000; i++) {
for (j = 0; j < 3; j++) {
@nanoninja
nanoninja / README.md
Last active September 7, 2018 14:22
MongoDB Service Installation
@nanoninja
nanoninja / .bash_prompt
Created November 9, 2016 12:57
Bash Prompt
#!/bin/bash
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
##############
### COLORS ###
##############
BLACK="\[\033[0;30m\]"
@nanoninja
nanoninja / settings.json
Last active July 3, 2017 13:17
VSC global configuration
{
"window.zoomLevel": 1,
"editor.fontSize": 15,
"editor.mouseWheelZoom": false,
"terminal.external.osxExec": "iTerm.app"
}
@nanoninja
nanoninja / binary_iota_accu.go
Last active November 1, 2016 11:52
Binary iota accu
package main
type Letter uint16
const (
A Letter = 1 << iota
B
C
D
All = (D << 1) - A
@nanoninja
nanoninja / gobot_chat.go
Last active October 21, 2016 22:32
Simple GoBot Chat
// Simple Chat Server. It does not broadcast to other people.
// It can be used to create a bot.
package main
import (
"bufio"
"fmt"
"io"
"log"
"net"
@nanoninja
nanoninja / time_display.go
Last active July 22, 2017 14:48
Go Time Display Using Ticker
package main
import (
"fmt"
"time"
)
func main() {
TimeDisplay(true)
}
@nanoninja
nanoninja / jose_jwt_go_usage.md
Created September 29, 2016 14:35
JOSE - JWT Usage Examples

JOSE - JWT Usage Examples

JOSE is a comprehensive set of JWT, JWS, and JWE libraries.

jwt.io

Installation

go get github.com/SermoDigital/jose
@nanoninja
nanoninja / flusher.go
Created September 3, 2016 13:07
Go HTTP Flusher Example
// http.Flusher example
package main
import (
"fmt"
"net/http"
"time"
)