Skip to content

Instantly share code, notes, and snippets.

Avatar
🌴
On vacation

Ivan Loh ivan-loh

🌴
On vacation
  • ERIAD SOLUTION PLT
  • Malaysia
View GitHub Profile
@ivan-loh
ivan-loh / compile-install-emacs.sh
Last active Jul 27, 2022
Compile and install emacs 28.1 for Ubuntu
View compile-install-emacs.sh
#!/bin/bash
sudo apt install build-essential texinfo libx11-dev libxpm-dev libjpeg-dev libpng-dev libgif-dev libtiff-dev libgtk2.0-dev libncurses-dev libgnutls28-dev
wget http://ftp.gnu.org/gnu/emacs/emacs-28.1.tar.gz
tar xvzf emacs-28.1.tar.gz
cd emacs-28.1
./configure
make
@ivan-loh
ivan-loh / Main.go
Last active Aug 8, 2019
Sample Bigquery Streaming
View Main.go
package main
import (
"cloud.google.com/go/bigquery"
"context"
"google.golang.org/api/googleapi"
"log"
"time"
)
@ivan-loh
ivan-loh / Job.go
Created Dec 14, 2018
golang google bigquery check for job error
View Job.go
package main
import (
"cloud.google.com/go/bigquery"
"context"
"log"
)
func main () {
@ivan-loh
ivan-loh / memory.sh
Created Dec 16, 2017
script to use to monitor memory utilization
View memory.sh
#!/bin/bash
function alert {
curl --header 'Access-Token: <access_token_here>' \
--header 'Content-Type: application/json' \
--data-binary '{"body":"Memory Threshold Reachd","title":"Database Server Alert","type":"note"}' \
--request POST \
https://api.pushbullet.com/v2/pushes
}
View rxjs_operators_by_example.md
@ivan-loh
ivan-loh / zeppelin-bq.MD
Created Mar 10, 2017
how to get zepplin's bq interpreter to play nice with bq
View zeppelin-bq.MD

too lazy to explain the steps but it goes something like this

  1. "install" gcloud sdk
  2. gcloud init
  3. bq command setup
  4. setup application default login gcloud auth application-default login --no-launch-browser
@ivan-loh
ivan-loh / Gitlab CI.md
Created Feb 20, 2017
Basic continuous deployment flow with GitLab Community Edition 8.16.6
View Gitlab CI.md
@ivan-loh
ivan-loh / read-csv.go
Created Dec 25, 2016
reading some csv file
View read-csv.go
package main
import (
"bufio"
"encoding/csv"
"fmt"
"io"
"log"
"os"
)
@ivan-loh
ivan-loh / main.go
Created Dec 25, 2016
mongodb crud in golang
View main.go
package main
import (
"fmt"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
"time"
)
type Person struct {
@ivan-loh
ivan-loh / rename.sh
Created Dec 12, 2016
bash script to mass rename files in a directory
View rename.sh
#!/bin/sh
SRCEXT="html"
DSTEXT="txt"
for file in *.$SRCEXT; do
echo "$file -> `basename "$file" .$SRCEXT`.$DSTEXT"
mv "$file" "`basename "$file" .$SRCEXT`.$DSTEXT"
done