Skip to content

Instantly share code, notes, and snippets.

Karan Misra kidoman

View GitHub Profile
@kidoman
kidoman / appengine_tls.go
Created Dec 14, 2014
Using custom certificates with AppEngine
View appengine_tls.go
package main
import (
"crypto/tls"
"crypto/x509"
"io/ioutil"
"net"
"net/http"
"appengine"
@kidoman
kidoman / gaesocket.go
Created Sep 23, 2014
Whats wrong with this?
View gaesocket.go
package web
import (
"io"
"net"
"net/http"
"appengine"
"appengine/socket"
)
@kidoman
kidoman / main.go
Created Jul 28, 2014
TLS Authenticated Docker
View main.go
package main
import (
"crypto/tls"
"crypto/x509"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
@kidoman
kidoman / results.md
Last active Aug 29, 2015
fibrous run results on a Late 2013 (i7 Haswell 2.3 Ghz 16 GB) MacBook Pro 15 Retina
View results.md
@kidoman
kidoman / sin.go
Created Jan 21, 2014
Sin kata in Go
View sin.go
package main
const accuracy = 0.00001
func multiplier(i int, angle, num, den float64) (float64, float64) {
num *= angle * angle
den *= float64(i * (i - 1))
return num, den
}
View saveme.go
package main
import (
"github.com/gorilla/mux"
rpio "github.com/stianeikeland/go-rpio"
"log"
"net/http"
"os"
"os/signal"
"time"
@kidoman
kidoman / test.go
Created Nov 20, 2013
Test Go on RPi
View test.go
package main
import (
rpio "github.com/stianeikeland/go-rpio"
"log"
"net/http"
)
func main() {
log.Print("Starting up...")
@kidoman
kidoman / main.go
Created Nov 6, 2013
A snatcher of sorts :)
View main.go
package main
import (
"errors"
"flag"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
@kidoman
kidoman / gist:6827452
Created Oct 4, 2013
Rand in Gorays which was not getting inlined
View gist:6827452
type randFn func() float64
func makeRand(seed uint32) randFn {
return func() float64 {
seed += seed
seed ^= 1
if int32(seed) < 0 {
seed ^= 0x88888eef
}
return float64(seed%95) / float64(95)
@kidoman
kidoman / card.cpp
Created Sep 26, 2013
Originally from http://www.cs.utah.edu/~aek/code/card.cpp Run with: c++ -O3 -o card card.cpp && ./card > aek.ppm
View card.cpp
#include <stdlib.h> // card > aek.ppm
#include <stdio.h>
#include <math.h>
typedef int i;typedef float f;struct v{
f x,y,z;v operator+(v r){return v(x+r.x
,y+r.y,z+r.z);}v operator*(f r){return
v(x*r,y*r,z*r);}f operator%(v r){return
x*r.x+y*r.y+z*r.z;}v(){}v operator^(v r
){return v(y*r.z-z*r.y,z*r.x-x*r.z,x*r.
y-y*r.x);}v(f a,f b,f c){x=a;y=b;z=c;}v
You can’t perform that action at this time.