Skip to content

Instantly share code, notes, and snippets.

@fonglh
fonglh / emailgen_main.go
Created August 17, 2017 10:33
Main function of random email generator
func main() {
rand.Seed(time.Now().UTC().UnixNano())
output, _ := os.Create("generated_names.txt")
defer output.Close()
for i := 0; i < 200; i++ {
name := GetRandomName(0)
email := fmt.Sprintf("%s@%s\n", name, domains[rand.Intn(len(domains))])
output.Write([]byte(email))
}
@fonglh
fonglh / postgres-config.md
Created November 18, 2015 08:33
Configuring PostgreSQL for Remote connections

Configuring PostgreSQL to accept Remote Connections

The default configuration after installing PostgreSQL 9.4 only allows localhost tcp connections, or using Unix domain sockets. This isn't sufficient when setting up a database server separate from the app server.

Enable listening on Network Interface

  1. Open /etc/postgresql/9.4/main/postgresql.conf and look for the listen_addresses setting. The default is localhost. Change it to *.
@fonglh
fonglh / gotour-sols.go
Last active November 20, 2015 14:00
Gotour solutions
// Exercise: Loops and Functions
package main
import (
"fmt"
"math"
)
func Sqrt(x float64) float64 {
z := float64(1)
@fonglh
fonglh / supermock.md
Created October 7, 2015 02:52
SuperMock's readme

SuperMock

SuperMock is a mockup tool meant to reduce the tedious repetition encountered when creating mockups with existing tools.

Installing

  1. Clone the repository
  2. bundle install
@fonglh
fonglh / README.md
Last active August 29, 2015 14:22 — forked from jsyeo/README.md

Bamboo Plan Dashing Widget

Dashing widget to display plan build details from your Bamboo instance.

Preview

Bamboo Dashing Widget

Installation