Skip to content

Instantly share code, notes, and snippets.

View IndianGuru's full-sized avatar

IndianGuru IndianGuru

View GitHub Profile
@IndianGuru
IndianGuru / struct.go
Last active September 26, 2016 07:57
Pwned Struct
type jResp struct {
Title string `json:"Title"`
Name string `json:"Name"`
Domain string `json:"Domain"`
BreachDate string `json:"BreachDate"`
AddedDate time.Time `json:"AddedDate"`
PwnCount int `json:"PwnCount"`
Description string `json:"Description"`
DataClasses []string `json:"DataClasses"`
IsVerified bool `json:"IsVerified"`
@IndianGuru
IndianGuru / jruby10.rb
Created September 5, 2011 10:07
JRuby and Amazon S3
require "rubygems"
require "bundler/setup"
require 'yaml'
require 'aws-sdk'
#require 'jruby-openssl'
bucket_name = "talim"
file_name = "jrubyaws.txt"
@IndianGuru
IndianGuru / mynsfw.go
Created May 24, 2016 04:29
Go and Clarifai API
package main
import (
"encoding/json"
"fmt"
"net/http"
"net/url"
"strings"
)
type FaceResp []struct {
FaceID string `json:"faceId"`
FaceRectangle struct {
Top int `json:"top"`
Left int `json:"left"`
Width int `json:"width"`
Height int `json:"height"`
} `json:"faceRectangle"`
FaceAttributes struct {
Gender string `json:"gender"`
@IndianGuru
IndianGuru / mcs.go
Created May 19, 2016 08:43
To access Microsoft's Face API
package main
import (
"bytes"
"encoding/json"
"fmt"
"log"
"net/http"
)
@IndianGuru
IndianGuru / gomongohql.go
Created September 27, 2015 07:39
gomongohql.go
package main
import (
"fmt"
"html/template"
"labix.org/v2/mgo"
"labix.org/v2/mgo/bson"
"log"
"net/http"
"os"
@IndianGuru
IndianGuru / gowatson.go
Last active May 9, 2016 02:39
Go program to use Watson
package main
import (
"fmt"
"io"
"log"
"net/http"
"os"
)
@IndianGuru
IndianGuru / apiaifile.go
Created May 3, 2016 04:14
Send text to get a .wav file
package main
import (
"fmt"
"io"
"log"
"net/http"
"os"
)
@IndianGuru
IndianGuru / apiai.go
Last active May 2, 2016 10:07
Go program that uses the api.ai service
package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"time"
)
@IndianGuru
IndianGuru / QResponse.txt
Created May 2, 2016 09:45
Sample Response Struct
type QResponse struct {
ID string `json:"id"`
Timestamp time.Time `json:"timestamp"`
Result struct {
Source string `json:"source"`
ResolvedQuery string `json:"resolvedQuery"`
Action string `json:"action"`
ActionIncomplete bool `json:"actionIncomplete"`
Parameters struct {
Name string `json:"name"`