Skip to content

Instantly share code, notes, and snippets.

View pbarker's full-sized avatar
🍾

Patrick Barker pbarker

🍾
  • Boulder, CO
View GitHub Profile
@maxivak
maxivak / xvfb-init
Last active May 4, 2017 14:09
Xvfb init script
#!/bin/bash
# xvfb - this script starts and stops Xvfb
#
# chkconfig: 345 95 50
# description: Starts xvfb on display 99
# processname: Xvfb
# pidfile: /var/log/xvfb/xvfb.pid
# Source function library.
@kunev
kunev / coroutines_example.py
Last active July 9, 2020 15:09
Coroutines example with python's asyncio module
import asyncio
@asyncio.coroutine
def open_file(name):
print("opening {}".format(name))
return open(name)
@asyncio.coroutine
def close_file(file):
print("closing {}".format(file.name))
@hellwen
hellwen / gist:8332740
Created January 9, 2014 11:28
CREATE EXCEL FILE WITH XLWT AND INSERT IN FLASK RESPONSE VALID FOR JQUERY.FILEDOWNLOAD
import xlwt
import StringIO
import mimetypes
from flask import Response
from werkzeug.datastructures import Headers
#... code for setting up Flask
@app.route('/export/')
def export_view():
@debasishg
debasishg / gist:8172796
Last active May 10, 2024 13:37
A collection of links for streaming algorithms and data structures

General Background and Overview

  1. Probabilistic Data Structures for Web Analytics and Data Mining : A great overview of the space of probabilistic data structures and how they are used in approximation algorithm implementation.
  2. Models and Issues in Data Stream Systems
  3. Philippe Flajolet’s contribution to streaming algorithms : A presentation by Jérémie Lumbroso that visits some of the hostorical perspectives and how it all began with Flajolet
  4. Approximate Frequency Counts over Data Streams by Gurmeet Singh Manku & Rajeev Motwani : One of the early papers on the subject.
  5. [Methods for Finding Frequent Items in Data Streams](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.187.9800&rep=rep1&t
@wowo
wowo / gender-module-installation.sh
Last active May 5, 2021 23:01
Guesing gender based on name in PHP
# install gender http://www.php.net/manual/en/book.gender.php
sudo apt-get install libpcre3-dev
sudo pecl install gender
# generate data
mkdir ~/gender
sudo pear run-scripts pecl/gender
# eneble module
echo 'extension=gender.so' >> /etc/php5/cli/php.ini
@mardambey
mardambey / KafkaEmbedded.scala
Created May 10, 2012 02:58
Embedded Kafka broker / producer / simple consumer in a single process useful for testing or for persistent queues.
import java.util.Properties
import kafka.server.KafkaServer
import kafka.server.KafkaConfig
import kafka.producer.ProducerConfig
import kafka.producer.Producer
import kafka.message.Message
import kafka.producer.ProducerData
import kafka.consumer.ConsumerConfig
import kafka.consumer.Consumer
import kafka.utils.Utils