Skip to content

Instantly share code, notes, and snippets.

@wrunk
wrunk / jinja2_file_less.py
Last active September 19, 2023 15:05
python jinja2 examples
#!/usr/bin/env/python
#
# More of a reference of using jinaj2 without actual template files.
# This is great for a simple output transformation to standard out.
#
# Of course you will need to "sudo pip install jinja2" first!
#
# I like to refer to the following to remember how to use jinja2 :)
# http://jinja.pocoo.org/docs/templates/
#
@cjgiridhar
cjgiridhar / sqliteform.html
Created August 25, 2012 16:39
Tornado - SQLite DB
<html>
<title>
SQLite Example
</title>
<body>
<FORM ACTION="/create" METHOD=POST>
Name: <input type="text" name="name">
Marks: <input type="text" name="marks">
@fperez
fperez / ProgrammaticNotebook.ipynb
Last active May 2, 2024 19:14
Creating an IPython Notebook programatically
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@abdelouahabb
abdelouahabb / app.py
Last active November 7, 2019 11:44
Using SQLite with Tornado. just a simple code, tornado is easy, and if you want to make a simple application that runs on the same server, use this Gist for less dependecies ^_^
#!/usr/bin/env python
#-*- coding:utf-8 -*-
import tornado.web
import tornado.httpserver
import tornado.ioloop
from tornado.options import define, options
import handlers
import os
# -*- coding: utf-8 -*-
"""
Creates a S3 bucket and displays the access key and scret that
will have access only to the created bucket.
Setup:
$ pip install boto3
Add AWS credentials which has create bucket and IAM create permission in environment
@monkut
monkut / Ubuntu1604py36Dockerfile
Last active June 14, 2023 20:31
Base Docker image for ubuntu-16.04 & Python3.6
# docker build -t ubuntu1604py36
FROM ubuntu:16.04
RUN apt-get update && \
apt-get install -y software-properties-common && \
add-apt-repository ppa:jonathonf/python-3.6
RUN apt-get update
RUN apt-get install -y build-essential python3.6 python3.6-dev python3-pip python3.6-venv
RUN apt-get install -y git
@F21
F21 / gist:08bfc2e3592bed1e931ec40b8d2ab6f5
Last active October 23, 2022 12:36
Minikube RBAC Quick Start
minikube start --kubernetes-version=v1.7.0 --extra-config=apiserver.Authorization.Mode=RBAC
kubectl create clusterrolebinding add-on-cluster-admin --clusterrole=cluster-admin --serviceaccount=kube-system:default
minikube dashboard
@minrk
minrk / index.html
Last active April 13, 2021 05:36
JupyterHub cross-origin test
<html>
<head>
<title>JupyterHub CORS test</title>
<script
src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin="anonymous">
</script>
<style type="text/css">
input[type=text] {