Skip to content

Instantly share code, notes, and snippets.

@serinth
serinth / install-opencv-2.4.11-in-ubuntu.sh
Last active September 12, 2016 11:01 — forked from dynamicguy/install-opencv-2.4.11-in-ubuntu.sh
install opencv-2.4.11 in ubuntu 16.0.4
# install dependencies
sudo apt-get update
sudo apt-get install -y build-essential
sudo apt-get install -y cmake
sudo apt-get install -y libgtk2.0-dev
sudo apt-get install -y pkg-config
sudo apt-get install -y python-numpy python-dev
sudo apt-get install -y libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install -y libjpeg-dev libpng-dev libtiff-dev libjasper-dev
@serinth
serinth / .vimrc
Last active February 17, 2018 09:34
vimrc for javascript, go and python (2 spaces for js, 4 for go and python)
" Setup vundle first: https://github.com/VundleVim/Vundle.vim
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
@serinth
serinth / curl_examples.md
Last active July 21, 2022 08:37
Curl Examples

Show Request and Response

curl -v www.example.com

HEADERS

curl --header "X-Signature: XXX" http://example.com/endpoint

curl -H "X-Signature: XXX" -H "Content-Type: application/json http://example.com/endpoint

VERBS

curl -X DELETE example.com

var AWS = require('aws-sdk');
AWS.config.region = 'ap-southeast-2';
var kms = new AWS.KMS({ apiVersion: '2014-11-01' });
var encryptedParams = {
CiphertextBlob: ''
};
kms.decrypt(encryptedParams, function(err, decryptedData){
@serinth
serinth / tweeHandler.go
Created June 16, 2017 06:44
DiUS NLP Blog Post Gist
package main
import (
"log"
language "cloud.google.com/go/language/apiv1"
"github.com/dghubble/go-twitter/twitter"
"golang.org/x/net/context"
languagepb "google.golang.org/genproto/googleapis/cloud/language/v1"
)
@serinth
serinth / pom.xml
Created November 19, 2017 21:38
Scala, Akka-HTTP, Json, Maven, Maven Shade
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany.myproject</groupId>
<artifactId>smartCapture</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>${project.artifactId}</name>
<description>Smart Capture</description>
<inceptionYear>2015</inceptionYear>
<licenses>
@serinth
serinth / makefile
Created March 8, 2018 19:21
Golang Makefile
# Basic Makefile for Golang project
# Includes GRPC Gateway, Protocol Buffers
SERVICE ?= $(shell basename `go list`)
VERSION ?= $(shell git describe --tags --always --dirty --match=v* 2> /dev/null || cat $(PWD)/.version 2> /dev/null || echo v0)
PACKAGE ?= $(shell go list)
PACKAGES ?= $(shell go list ./...)
FILES ?= $(shell find . -type f -name '*.go' -not -path "./vendor/*")
# Binaries
PROTOC ?= protoc
@serinth
serinth / .gitlab-ci.yml
Created March 8, 2018 19:27
React gitlab-ci-cd. Tag Based with RC on Test environment Dev/Test/Prod
image: node:8
stages:
- test
- build
- deploy
.deploy_template: &deploy_template
before_script:
- apt-get update
@serinth
serinth / test-tf-gpu.py
Last active June 7, 2018 03:03
Tests tensorflow-gpu installation
from tensorflow.python.client import device_lib
def get_available_gpus():
local_device_protos = device_lib.list_local_devices()
return [x.name for x in local_device_protos if x.device_type == 'GPU']
get_available_gpus()
@serinth
serinth / go-xorm-sqlnull.md
Created April 29, 2018 23:30
Golang XORM mapping null values in response and in DB. Uses protocol buffers

model.proto file:

import "google/protobuf/wrappers.proto";

message Entity {
	google.protobuf.UInt32Value myField  = 1;
}