Skip to content

Instantly share code, notes, and snippets.

View gigenthomas's full-sized avatar
🎯
Focusing

Gigen Thomas gigenthomas

🎯
Focusing
View GitHub Profile
@gigenthomas
gigenthomas / golang_on_rpi.md
Created December 18, 2016 23:18 — forked from konradko/golang_on_rpi.md
Install Golang 1.7 on Raspberry Pi
wget https://storage.googleapis.com/golang/go1.7.linux-armv6l.tar.gz
tar -C /usr/local -xzf go1.7.linux-armv6l.tar.gz
export PATH=$PATH:/usr/local/go/bin
@gigenthomas
gigenthomas / Docker
Last active December 12, 2016 07:57
List of Docker Commands
# Show running docker containers
docker ps
#Remove all docker images
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
#Delete a docker image
docker rmi <image_id>
UTC to Date
====
LocalDateTime ldt = LocalDateTime.now(Clock.systemUTC());
Instant instant = ldt.toInstant(ZoneOffset.UTC);
Date now = Date.from(instant);
@gigenthomas
gigenthomas / Article.java
Created February 23, 2016 06:51 — forked from php-coder/Article.java
JPA @EntityListeners example
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
@gigenthomas
gigenthomas / gist:f8c89be276768b0acc6e
Last active February 6, 2016 05:15
PostGres Commands
1. Connect to Database
psql -U username database
Unix account login using local authentication
psql database
2. List Database
\l
3. List Tables
@gigenthomas
gigenthomas / client.go
Created January 21, 2016 06:56 — forked from spikebike/client.go
TLS server and client
package main
import (
"crypto/tls"
"crypto/x509"
"fmt"
"io"
"log"
)
@gigenthomas
gigenthomas / api.proxy.server.js
Created December 3, 2015 04:58 — forked from davemo/api.proxy.server.js
A simple express.js server with a proxy that intercepts all requests with /api/ and proxies them to localhost:3000
var express = require('express'),
httpProxy = require('http-proxy'),
app = express();
var proxy = new httpProxy.RoutingProxy();
function apiProxy(host, port) {
return function(req, res, next) {
if(req.url.match(new RegExp('^\/api\/'))) {
proxy.proxyRequest(req, res, {host: host, port: port});
user jessed staff;
worker_processes 2;
events {
worker_connections 1024;
}
http {
include mime.types;
git commit -a -m 'added new benchmarks'
automatically stage every file that is already tracked before doing the commit, letting you skip the git add part:
Rename a file in git
$ git mv file_from file_to
Show a history of commits
$ git log -p -2
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.2.6.RELEASE")
}
}
apply plugin: 'java'