Skip to content

Instantly share code, notes, and snippets.

Karan Misra kidoman

Block or report user

Report or block kidoman

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@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 / 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 / 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 / .rbenv-version
Created Oct 31, 2012
A simple ruby wrapper script over OpenSSL to assist in encryption/decryption using your RSA keys (id_rsa/id_rsa.pub will do just fine)
@kidoman
kidoman / htpasswd-ssha.sh
Created Jan 16, 2013
htpasswd-ssha script fixed to work in Ubuntu 12.04 Must run before using this script: sudo apt-get install libdigest-sha-perl sudo apt-get install libterm-readkey-perl
View htpasswd-ssha.sh
#!/usr/bin/perl
#########################################################################
# htpasswd-ssha is a replacement of the well known apache htpasswd.
# All written in pure perl, it allows you to crypt SSHA passowrd for
# nginx per example.
#
# Copyright (C) 2011 Guillaume Seigneuret (Omega Cube)
#
# This program is free software: you can redistribute it and/or modify
@kidoman
kidoman / generate.go
Last active Dec 22, 2015
Generate n random data files of given size
View generate.go
package main
import (
"crypto/rand"
"crypto/sha1"
"encoding/hex"
"flag"
"fmt"
"io"
"io/ioutil"
@kidoman
kidoman / dining_gophers.go
Last active Dec 23, 2015
My attempt at a "Dining Philosophers" simulation using Go concurrency Play version at: http://play.golang.org/p/Cy0ReZARbK
View dining_gophers.go
// Dining Gophers^2
// - By Karan
package main
import (
"flag"
"log"
"runtime"
"time"
View crays.cpp
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
typedef int i; //Save space by using 'i' instead of 'int'
typedef float f; //Save even more space by using 'f' instead of 'float'
//Define a vector class with constructor and operator: 'v'
struct v {
f x,y,z; // Vector has three float attributes.
@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
@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)
You can’t perform that action at this time.