Skip to content

Instantly share code, notes, and snippets.

View amitnabarro's full-sized avatar

Amit Nabarro amitnabarro

View GitHub Profile
@monkut
monkut / serving-sphinx-docs-on-s3.md
Created May 8, 2018 05:35
Serving Sphinx Documentation on s3

Build your sphinx document

Assumes you already have a sphinx project installed and a project created

make html

By default this command will build documentation to _build/html

@antoinerousseau
antoinerousseau / SpeedDial.css
Created November 25, 2016 15:17
SpeedDial with material-ui
.cover {
position: fixed;
width: 100%;
top: 0;
left: 0;
z-index: 1100; /* just above title bar */
transition: opacity 0.2s ease-in-out;
opacity: 1;
/* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#5dc1b2+0,1fbcd2+100 */
@drgarcia1986
drgarcia1986 / tornado_asyncio.py
Last active August 7, 2021 15:57
Tornado and Asyncio Mixed example
# -*- coding: utf-8 -*-
import asyncio
import re
import asyncio_redis
import tornado.concurrent
import tornado.httpclient
import tornado.web
import tornado.platform.asyncio
@akhoury
akhoury / handlebars-helper-x.js
Last active February 17, 2024 13:25
Handlebars random JavaScript expression execution, with an IF helper with whatever logical operands and whatever arguments, and few more goodies.
// for detailed comments and demo, see my SO answer here http://stackoverflow.com/questions/8853396/logical-operator-in-a-handlebars-js-if-conditional/21915381#21915381
/* a helper to execute an IF statement with any expression
USAGE:
-- Yes you NEED to properly escape the string literals, or just alternate single and double quotes
-- to access any global function or property you should use window.functionName() instead of just functionName()
-- this example assumes you passed this context to your handlebars template( {name: 'Sam', age: '20' } ), notice age is a string, just for so I can demo parseInt later
<p>
{{#xif " name == 'Sam' && age === '12' " }}
BOOM
import pymongo
from pymongo import Connection
from pymongo.dbref import DBRef
from pymongo.database import Database
# connect
connection = Connection()
db = Database(connection, "things")
# clean up