Skip to content

Instantly share code, notes, and snippets.

Avatar

Varun varunpant

View GitHub Profile
@varunpant
varunpant / API.md
Created Jul 5, 2018 — forked from iros/API.md
Documenting your REST API
View API.md

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@varunpant
varunpant / Makefile
Last active May 6, 2018 — forked from azer/Makefile
Makefile for Go Projects
View Makefile
GOPATH=$(shell pwd)/vendor:$(shell pwd)
GOBIN=$(shell pwd)/bin
GOFILES=$(wildcard *.go)
GONAME=$(shell basename "$(PWD)")
PID=/tmp/go-$(GONAME).pid
build:
@echo "Building $(GOFILES) to ./bin"
@GOPATH=$(GOPATH) GOBIN=$(GOBIN) go build -o bin/$(GONAME) $(GOFILES)
get:
@varunpant
varunpant / Dockerfile-Java9-with-maven3
Last active Mar 13, 2018
Docker Image for Oracle Java with maven 3
View Dockerfile-Java9-with-maven3
FROM oraclelinux:7-slim
# Download tar from http://www.oracle.com/technetwork/java/javase/downloads/server-jre9-downloads-3848530.html
#d29b6b3008c814abd8ab5e4bde9278d6ee7699898333992ee8d080612b5197ca serverjre-9.0.4_linux-x64_bin.tar.gz
MAINTAINER Varun Pant <varun@varunpant.com>
ENV JAVA_PKG=serverjre-9*_linux-x64_bin.tar.gz \
JAVA_HOME=/usr/java/default
ADD $JAVA_PKG /usr/java/
@varunpant
varunpant / main.go
Created Jan 7, 2018 — forked from enricofoltran/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
View main.go
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@varunpant
varunpant / meta-tags.md
Created Mar 5, 2016 — forked from whitingx/meta-tags.md
Complete List of HTML Meta Tags
View meta-tags.md

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
@varunpant
varunpant / handlers.py
Created Oct 25, 2015 — forked from jgeewax/handlers.py
webapp2_extras auth example (copy/paste)
View handlers.py
# -*- coding: utf-8 -*-
"""
A real simple app for using webapp2 with auth and session.
It just covers the basics. Creating a user, login, logout and a decorator for protecting certain handlers.
PRE-REQUIREMENTS:
Set at secret_key in webapp2 config:
@varunpant
varunpant / GoogleMapsCustomRasterOverlay
Created Sep 21, 2015
Google Maps ,custom raster overlay example with Tilestache
View GoogleMapsCustomRasterOverlay
<!DOCTYPE html>
<html>
<head>
<title>Overlay map types</title>
<style>
html, body, #map-canvas {
height: 100%;
margin: 0px;
padding: 0px
@varunpant
varunpant / gist:383beca43c63ef0bf4cb
Created Nov 5, 2014
Geocode using google in Google spread sheet
View gist:383beca43c63ef0bf4cb
// Global variables
var ss = SpreadsheetApp.getActiveSpreadsheet(),
sheet = ss.getActiveSheet(),
activeRange = ss.getActiveRange(),
settings = {};
var geocoders = {
google: {
query: function(query, key) {
return 'https://maps.googleapis.com/maps/api/geocode/json?address=' + query;//+'&key=' + key
@varunpant
varunpant / autocomplete-redis-python.py
Created May 6, 2012
Redis autocomplete example in python (Port of Antirez)
View autocomplete-redis-python.py
import redis
r = redis.StrictRedis(host='localhost', port=6379, db=0)
# Create the completion sorted set
if r.exists('compl') == False:
print "Loading entries in the Redis DB\n"
f = open('female-names.txt',"r")
for line in f:
n = line.strip()
You can’t perform that action at this time.