Skip to content

Instantly share code, notes, and snippets.

View broklyngagah's full-sized avatar

pieter lelaona broklyngagah

  • Rebelworks
  • Jakarta
View GitHub Profile
@broklyngagah
broklyngagah / .htaccess
Last active February 14, 2021 16:06 — forked from ronaldsgailis/.htaccess
Files for simple url shortener in PHP and MySQL
#just add comment
RewriteEngine On
RewriteBase /
RewriteRule ^shorten/(.*)$ shorten.php?url=$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?code=$1 [L,QSA]
@broklyngagah
broklyngagah / GoMgoSample-1.go
Created January 25, 2018 09:45 — forked from ardan-bkennedy/GoMgoSample-1.go
Sample Go and MGO example
type (
// BuoyCondition contains information for an individual station.
BuoyCondition struct {
WindSpeed float64 `bson:"wind_speed_milehour"`
WindDirection int `bson:"wind_direction_degnorth"`
WindGust float64 `bson:"gust_wind_speed_milehour"`
}
// BuoyLocation contains the buoy's location.
BuoyLocation struct {
@broklyngagah
broklyngagah / graceful.go
Created January 14, 2018 13:31 — forked from peterhellberg/graceful.go
*http.Server in Go 1.8 supports graceful shutdown. This is a small example.
package main
import (
"context"
"log"
"net/http"
"os"
"os/signal"
"time"
)
@broklyngagah
broklyngagah / sendMail.go
Created September 21, 2017 07:56 — forked from andelf/sendMail.go
golang send mail net/smtp SMTP
package main
import (
"log"
"net/mail"
"encoding/base64"
"net/smtp"
"fmt"
"strings"
@broklyngagah
broklyngagah / underscore.go
Created August 31, 2017 08:09 — forked from regeda/underscore.go
Convert CamelCase to underscore in golang
package main
import (
"testing"
"unicode"
"unicode/utf8"
"github.com/stretchr/testify/assert"
)
@broklyngagah
broklyngagah / golang_job_queue.md
Created August 16, 2017 22:20 — forked from harlow/golang_job_queue.md
Job queues in Golang
@broklyngagah
broklyngagah / worker-pool.go
Created August 16, 2017 22:20 — forked from harlow/worker-pool.go
Worker pool to control concurrency and collect results
package main
import (
"fmt"
"sync"
"time"
)
const concurrency = 3
@broklyngagah
broklyngagah / generator.go
Created August 3, 2017 19:01 — forked from mfojtik/generator.go
Simple generator for Golang
package main
import (
"fmt"
"log"
"math/rand"
"regexp"
"strconv"
"strings"
"time"
# supervisor
#
# Author: Günter Grodotzki <[email protected]>
# Version: 2015-04-25
#
# set param "SUPERVISE=enable" to activate
#
packages:
yum:
python27-setuptools: []
@broklyngagah
broklyngagah / Laravel PHP7 LEMP AWS.md
Created February 13, 2017 23:37 — forked from santoshachari/Laravel PHP7 LEMP AWS.md
Laravel 5.x on Ubuntu 14.x, PHP 7.x, Nginx 1.9.x

#Steps to install latest Laravel, LEMP on AWS Ubuntu 14.4 version. This tutorial is the improvised verision of this tutorial on Digitalocean based on my experience.

Install PHP 7 on Ubuntu

Run the following commands in sequence.

sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip