Skip to content

Instantly share code, notes, and snippets.

View vibster's full-sized avatar
😀

Vibhu.Mittal vibster

😀
View GitHub Profile
@vibster
vibster / plate-snitch.js
Created October 25, 2017 13:14 — forked from taitems/plate-snitch.js
Image processing to identify license plate
openalpr.IdentifyLicense(imagePath, function (error, output) {
// handle result
});
@vibster
vibster / pg-pong.py
Created June 12, 2016 19:42 — forked from karpathy/pg-pong.py
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert $1 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 $2

Results

/**
* Circular Tooltip (SO)
* http://stackoverflow.com/q/13132864/1397351
*/
* { margin: 0; padding: 0; }
body {
overflow: hidden;
background: url(http://theearlcarlson.com/experiments/amTooltip/img/bg.jpg);
}
/* generic styles for button & circular menu */
@vibster
vibster / types-of-lists.md
Created September 13, 2012 04:30 — forked from shazow/types-of-lists.md
Catalogue of the different kinds of lists we compose in our day-to-day lives.

Types of lists

Catalogue of the different kinds of lists we compose in our day-to-day lives

  • Bucket list

    Such as "Things to do before you die". Typically aspirational, completeable. Manual sorting (usually importance or desired completion order).

@vibster
vibster / perlin-noise-classical.js
Created August 17, 2012 05:09 — forked from banksean/perlin-noise-classical.js
two Perlin noise generators in javascript. The simplex version is about 10% faster (in Chrome at least, haven't tried other browsers)
// Ported from Stefan Gustavson's java implementation
// http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf
// Read Stefan's excellent paper for details on how this code works.
//
// Sean McCullough banksean@gmail.com
/**
* You can pass in a random number generator object if you like.
* It is assumed to have a random() method.
*/
@vibster
vibster / index.html
Created August 4, 2012 13:45 — forked from hemulin/index.html
Example of zoomable padded d3 treemap - currently without parents titles
<html>
<head>
<script type="text/javascript" src="http://d3js.org/d3.v2.js"></script>
<script type="text/javascript" src="https://github.com/mbostock/d3/blob/master/src/layout/treemap.js"></script>
<script type="text/javascript" src="https://github.com/mbostock/d3/blob/master/src/layout/hierarchy.js"></script>
<style type="text/css">
rect {
fill: none;
stroke: #fff;
@vibster
vibster / perlin-noise-classical.js
Created July 18, 2012 23:51 — forked from banksean/perlin-noise-classical.js
two Perlin noise generators in javascript. The simplex version is about 10% faster (in Chrome at least, haven't tried other browsers)
// Ported from Stefan Gustavson's java implementation
// http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf
// Read Stefan's excellent paper for details on how this code works.
//
// Sean McCullough banksean@gmail.com
/**
* You can pass in a random number generator object if you like.
* It is assumed to have a random() method.
*/
@vibster
vibster / index.html
Created May 30, 2012 10:57 — forked from sido/index.html
Flashcard UI: Part 1
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>ui.Flashcard</title>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/pepper-grinder/jquery-ui.css">
<link rel="stylesheet" href="ui.flashcard.css">
<style>
body { font-family: sans-serif; }
#myFlashcard { margin: 2em auto; }
@vibster
vibster / index.html
Created May 25, 2012 21:18 — forked from sido/index.html
Flashcard UI: Part 1
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>ui.Flashcard</title>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/pepper-grinder/jquery-ui.css">
<link rel="stylesheet" href="ui.flashcard.css">
<style>
body { font-family: sans-serif; }
#myFlashcard { margin: 2em auto; }