Skip to content

Instantly share code, notes, and snippets.

Avatar
👋

Mike DePalatis mivade

👋
View GitHub Profile
@a10y
a10y / nginx.conf
Last active Jan 23, 2016
Nginx + LetsEncrypt Configuration With Proxying to Github Pages
View nginx.conf
worker_processes 1;
events {
worker_connections 1024;
}
http {
server {
listen 80;
server_name aduffy.org;
@yoavram
yoavram / .travis.yml
Last active Jun 7, 2019
Build and deploy conda packages to Anaconda.org from Travis-CI
View .travis.yml
language: python
python:
- 2.7
- 3.4
# Setup anaconda
before_install:
- wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
- chmod +x miniconda.sh
- ./miniconda.sh -b
@drgarcia1986
drgarcia1986 / __main__.py
Last active Jun 13, 2021
Example of OAuth2 autentication server with Client Credentials grant (using python-oauth2 and tornado)
View __main__.py
# !/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Diego Garcia'
import tornado.web
import tornado.ioloop
import oauth2.tokengenerator
import oauth2.grant
import oauth2.store.redisdb
import oauth2.store.mongodb
@UnderGreen
UnderGreen / installation.rst
Last active Oct 29, 2020 — forked from marcinkuzminski/installation.rst
Installation instruction for Kallithea
View installation.rst

Setting up Kallithea on Ubuntu Server 12.04

Preparation

  1. Install Ubuntu Server.
  2. Update Ubuntu with the commands:
@arvidfm
arvidfm / asyncio-tornado.py
Last active Dec 4, 2018
Running Tornado on asyncio's event loop, including 'yield from' support in request handlers
View asyncio-tornado.py
import asyncio
import tornado.concurrent
import tornado.ioloop
import tornado.web
import tornado.platform.asyncio
import tornado.httpclient
class ReqHandler(tornado.web.RequestHandler):
async def get(self):
@YukiSakamoto
YukiSakamoto / hdf5_simple.cpp
Created Aug 23, 2013
simple example to write hdf5 using c++.
View hdf5_simple.cpp
#include <string>
#include <iostream>
#include "H5Cpp.h"
#define MAX_NAME_LENGTH 32
const std::string FileName("SimpleCompound.h5");
const std::string DatasetName("PersonalInformation");
const std::string member_age("Age");
const std::string member_sex("Sex");
const std::string member_name("Name");
@yanmhlv
yanmhlv / gist:6220591
Created Aug 13, 2013
Launch PyQt4 with tornado
View gist:6220591
import tornado.ioloop
import tornado.autoreload
from PyQt4 import QtGui
import sys
class Window(QtGui.QWidget):
def __init__(self):
super(Window, self).__init__()
self.timer = tornado.ioloop.PeriodicCallback(self.printable, 300)
self.timer.start()
@ajdavis
ajdavis / client.py
Created May 22, 2013
Big download demo with Tornado 3.0.1 and pycurl.
View client.py
from tornado.httpclient import HTTPRequest, AsyncHTTPClient
import tornado.ioloop
import tornado.web
from tornado import gen
GB = 1024 * 1024 * 1024
total_downloaded = 0
def streaming_callback(chunk):
@methane
methane / gist:2185380
Created Mar 24, 2012
Tornado Example: Delegating an blocking task to a worker thread pool from an asynchronous request handler
View gist:2185380
from time import sleep
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
from tornado.web import Application, asynchronous, RequestHandler
from multiprocessing.pool import ThreadPool
_workers = ThreadPool(10)
def run_background(func, callback, args=(), kwds={}):
def _callback(result):