Skip to content

Instantly share code, notes, and snippets.

View vgoklani's full-sized avatar

Vishal Goklani vgoklani

View GitHub Profile
R = React.DOM
nations = ['britain', 'ireland', 'norway', 'sweden', 'denmark', 'germany',
'holland', 'belgium', 'france', 'spain', 'portugal', 'italy', 'switzerland']
Typeahead = React.createClass
getInitialState : -> {input: ""}
handleChange : -> @setState input: @refs.field.getDOMNode().value
handleClick : (nation)-> @setState input: nation
matches : (input)->
@vgoklani
vgoklani / README.md
Created October 13, 2015 15:49 — forked from slashdotdash/README.md
React + D3 (v2)

Multi-series bar chart rendered using React and D3.

@vgoklani
vgoklani / matrix-sgd.py
Last active August 29, 2015 14:26 — forked from shulhi/matrix-sgd.py
Low Rank appromixation using SGD
#!/usr/bin/python
#
# Created by Albert Au Yeung (2010)
#
# An implementation of matrix factorization
# http://www.quuxlabs.com/blog/2010/09/matrix-factorization-a-simple-tutorial-and-implementation-in-python/
#
try:
import numpy
except:

CSS Price Table

Flat pricing table.

<!DOCTYPE html>
<html lang="en">
<head>
<!-- Le styles -->
<link href="../bootstrap/css/bootstrap.css" rel="stylesheet">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js"></script>
</head>
<body>
/** @jsx React.DOM */
var LopMonHoc = React.createClass({
getInitialState: function(){
return {data: []}
},
loadData: function(){
$.ajax({
url: '/daotao/lops',
success: function(data){

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

from concurrent.futures import ThreadPoolExecutor
from functools import partial, wraps
import time
import tornado.ioloop
import tornado.web
EXECUTOR = ThreadPoolExecutor(max_workers=4)
/* borderless table */
.table.table-borderless td, .table.table-borderless th {
border: 0 !important;
}
.table.table-borderless {
margin-bottom: 0px;
}
@vgoklani
vgoklani / README.md
Last active August 29, 2015 14:15 — forked from lbolla/README.md

Asynchronous programming with Tornado

Asynchronous programming can be tricky for beginners, therefore I think it's useful to iron some basic concepts to avoid common pitfalls.

For an explanation about generic asynchronous programming, I recommend you one of the [many][2] [resources][3] [online][4].

I will focus on solely on asynchronous programming in [Tornado][1]. From Tornado's homepage: