Skip to content

Instantly share code, notes, and snippets.

@ykyuen
ykyuen / .gitlab-ci.yaml
Created December 18, 2017 02:38
a-simple-gitlab-ci-example-02
lint css:
stage: lint-css # <- Should map to the value defined in the 'stages'
before_script: # <- Pre-script
- npm install
cache: # <- Enable caching on files so they are available in the next stage
untracked: true # <- Cache the git untracked files (ex. node_modules)
only:
- master # <- This stage run only on master branch update
script: # <- The actually script of this stage
- ./node_modules/gulp/bin/gulp.js lint-css
@ykyuen
ykyuen / .gitlab-ci.yaml
Created December 18, 2017 02:36
a-simple-gitlab-ci-example-01
stages:
- lint-css
- lint-js
- unit-test
image: node:6.11.2
lint css:
stage: lint-css
@ykyuen
ykyuen / main.go
Created January 22, 2018 02:53
manage-go-dependencies-using-dep-01
package main
import humanize "github.com/dustin/go-humanize"
import "fmt"
func main() {
fmt.Println("hello world")
fmt.Printf("That file is %s.\n", humanize.Bytes(82854982)) // That file is 83 MB.
fmt.Printf("You're my %s best friend.\n", humanize.Ordinal(193)) // You are my 193rd best friend.
fmt.Printf("You owe $%s.\n", humanize.Comma(6582491)) // You owe $6,582,491.
@ykyuen
ykyuen / Gopkg.toml
Last active January 22, 2018 03:09
manage-go-dependencies-using-dep-02
# Gopkg.toml example
#
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
@ykyuen
ykyuen / Gopkg.lock.diff
Created January 22, 2018 03:12
manage-go-dependencies-using-dep-03
--- /home/ykyuen/go/src/gitlab.com/ykyuen/dep-example/Gopkg.lock
+++ # This file is autogenerated, do not edit; changes
@@ -2,14 +2,13 @@
[[projects]]
- branch = "master"
name = "github.com/dustin/go-humanize"
packages = ["."]
- revision = "bb3d318650d48840a39aa21a027c6630e198e626"
@ykyuen
ykyuen / main.go
Created January 22, 2018 03:16
manage-go-dependencies-using-dep-04
package main
import humanize "github.com/dustin/go-humanize"
import accounting "github.com/leekchan/accounting"
import "math/big"
import "fmt"
func main() {
fmt.Println("hello world")
fmt.Printf("That file is %s.\n", humanize.Bytes(82854982)) // That file is 83 MB.
@ykyuen
ykyuen / main.go
Created March 4, 2018 08:40
driving-web-browser-in-go-01
package main
import (
"log"
"github.com/sclevine/agouti"
)
func main() {
// driver := agouti.PhantomJS()
@ykyuen
ykyuen / Gopkg.toml
Created March 4, 2018 08:42
driving-web-browser-in-go-02
[[constraint]]
name = "github.com/sclevine/agouti"
branch = "master"
@ykyuen
ykyuen / main.go
Created March 4, 2018 08:46
driving-web-browser-in-go-03
package main
import (
"log"
"github.com/sclevine/agouti"
)
func main() {
// driver := agouti.PhantomJS()
@ykyuen
ykyuen / command.sh
Created June 14, 2018 03:17
docker-container-log-rotation-01
truncate -s 0 <logfile>