Skip to content

Instantly share code, notes, and snippets.

View roylee0704's full-sized avatar
πŸ§˜β€β™‚οΈ

roylee0704

πŸ§˜β€β™‚οΈ
  • Bangkok, Thailand
View GitHub Profile
@nf
nf / vm-setup.sh
Last active June 14, 2023 22:08
Script for setting up Debian Jessie VM with my development environment
#!/bin/bash -e
echo '
PATH=$HOME/go/bin:$PATH
export GOPATH=$HOME
export CDPATH=.:$HOME/src/golang.org/x:$HOME/go/src:$HOME/src/github.com:$HOME/src/github.com/nf:$HOME/src/github.com/adg
export EDITOR=vim
' >> ~/.profile
sudo apt-get update
@nackjicholson
nackjicholson / theWidgetKing.js
Last active August 29, 2015 14:16
The Widget King A tale written in javascript monad streams
// What do you guys think about this as a way to possibly pass streams
// around from one module to another? I don't think it comes up in simple
// examples but I can see in complex cases where if you wanted a separation of
// concerns for a stream, that you might want them to be passed around. It
// kind of opens up a protocol for communication between modules.
//
// Essentially this is a widgetMaker module which is responsible for making
// widgets. And the widgetKing module wants to be notified every time a widget
// comes off the factory floor.
@joshrotenberg
joshrotenberg / consumer_test.go
Last active September 8, 2016 04:50
nsq consumer testing
package consumer
import (
"errors"
"testing"
"github.com/bitly/go-nsq"
)
// tests nsq.HandlerFunc. just write the function in line in the test
@voxxit
voxxit / USING-VAULT.md
Last active July 7, 2022 03:02
Consul + Vault + MySQL = <3
git clone https://gist.github.com/dd6f95398c1bdc9f1038.git vault
cd vault
docker-compose up -d
export VAULT_ADDR=http://192.168.99.100:8200

Initializing a vault:

vault init
@larryprice
larryprice / Dockerfile
Created June 26, 2015 14:01
Golang dockering with gpm vendoring
FROM golang:1.4
# install gpm
RUN git clone https://github.com/pote/gpm.git /tmp/gpm
WORKDIR /tmp/gpm
RUN ./configure && make install
# sets the working directory to the application source for convenience
ADD . /go/src/github.com/larryprice/myapp
WORKDIR /go/src/github.com/larryprice/myapp
.
β”œβ”€β”€ books
β”‚Β Β  β”œβ”€β”€ handlers.go
β”‚Β Β  └── models.go
β”œβ”€β”€ config
β”‚Β Β  └── db.go
└── main.go
@alyssaq
alyssaq / main.go
Last active March 11, 2025 12:35
GET and POST golang API
/*
* Sample API with GET and POST endpoint.
* POST data is converted to string and saved in internal memory.
* GET endpoint returns all strings in an array.
*/
package main
import (
"encoding/json"
"flag"
@rauchg
rauchg / README.md
Last active April 13, 2025 04:29
require-from-twitter
@mpneuried
mpneuried / Makefile
Last active April 12, 2025 09:08
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)
@fuglede
fuglede / tensorflow101.ipynb
Last active August 30, 2023 06:45
TensorFlow 101
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.