Skip to content

Instantly share code, notes, and snippets.

{{define "layout"}}
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>{{template "title"}}</title>
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js">
</script>
</head>
{{define "layout"}}
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>{{template "title"}}</title>
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js">
</script>
</head>
@VimleshS
VimleshS / main.go
Created January 18, 2016 12:35 — forked from mattetti/main.go
Go's reflection example
package main
import(
"fmt"
"reflect"
)
func main(){
// iterate through the attributes of a Data Model instance
for name, mtype := range attributes(&Dish{}) {
@VimleshS
VimleshS / db.go
Created January 20, 2016 10:35 — forked from SchumacherFM/db.go
GoLang Database SQL: Selecting an unknown amount of columns from a query. Benchmark results in db_test.go
package main
import (
"database/sql"
"fmt"
_ "github.com/go-sql-driver/mysql"
"log"
)
const (
@VimleshS
VimleshS / digital_ocean_setup.md
Created January 21, 2016 12:25 — forked from ChuckJHardy/digital_ocean_setup.md
DigitalOcean Ubuntu 14.04 x64 + Rails 4 + Nginx + Unicorn + PostgreSQL + Capistrano 3 Setup Instructions

DigitalOcean Ubuntu 14.04 x64 + Rails 4 + Nginx + Unicorn + PostgreSQL + Capistrano 3

SSH into Root

$ ssh root@123.123.123.123

Change Root Password

package main
import (
"github.com/gin-gonic/gin"
"io/ioutil"
"log"
"net/http"
)
type LoginJSON struct {
@VimleshS
VimleshS / gist:e5320d81f55b758f0babc16f912332d0
Created May 6, 2016 07:17 — forked from telephone/gist:3869611
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Ubuntu)

General

Ctrl+KB toggle side bar
Ctrl+Shift+P command palette
Ctrl+` python console
Ctrl+N new file

Editing

@VimleshS
VimleshS / gist:a6f98f55bab85afb6d5a704515ba6678
Created June 13, 2016 09:25 — forked from ryansobol/gist:5252653
15 Questions to Ask During a Ruby Interview

Originally published in June 2008

When hiring Ruby on Rails programmers, knowing the right questions to ask during an interview was a real challenge for me at first. In 30 minutes or less, it's difficult to get a solid read on a candidate's skill set without looking at code they've previously written. And in the corporate/enterprise world, I often don't have access to their previous work.

To ensure we hired competent ruby developers at my last job, I created a list of 15 ruby questions -- a ruby measuring stick if you will -- to select the cream of the crop that walked through our doors.

What to expect

Candidates will typically give you a range of responses based on their experience and personality. So it's up to you to decide the correctness of their answer.

@VimleshS
VimleshS / golang-tls.md
Created August 30, 2016 07:09 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples
Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048
    
# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
openssl ecparam -genkey -name secp384r1 -out server.key
@VimleshS
VimleshS / tls-client.go
Created August 30, 2016 07:11 — forked from michaljemala/tls-client.go
SSL Client Authentication Golang sample
package main
import (
"crypto/tls"
"crypto/x509"
"flag"
"io/ioutil"
"log"
"net/http"
)