Skip to content

Instantly share code, notes, and snippets.

View leoncamel's full-sized avatar
Focusing

Xiaolin Zhang leoncamel

Focusing
  • Beijing
View GitHub Profile
@leoncamel
leoncamel / gist:dfc0492777bc2db97739
Created July 14, 2014 11:09
Docker build by docker-py
import docker
c = docker.Client(base_url="http://localhost:port", version="1.11")
print(c.version())
for i in c.build(fileobj=open("file.tar"), stream=True, custom_context=True):
print(i)
#!/usr/bin/env python
# Reference:
# [1] http://matplotlib.org/examples/pylab_examples/multipage_pdf.html
# This should be executed before other matplotlib imports
import matplotlib
matplotlib.use('Agg')
import datetime
#!/bin/bash
#
# Reference : http://www.transtats.bts.gov/DL_SelectFields.asp?Table_ID=236&DB_Short_Name=On-Time
#
now=`date +"%Y-%m-%d" -d "01/01/1987"`
end=`date +"%Y-%m-%d" -d "05/01/2015"`
# end=`date +"%Y-%m-%d"`
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
def build_argparser():
parser = argparse.ArgumentParser()
parser.add_argument('--foo', action='store_true', help='foo help')
@leoncamel
leoncamel / Makefile
Last active May 18, 2016 06:10
minimum libhdfs example
CC=gcc
JVM_ROOT=/usr/lib/jvm/java-7-openjdk-amd64/
HADOOP_ROOT=/home/xiaolin/work/apache/hadoop-2.7.1
export CLASSPATH=$(shell ${HADOOP_ROOT}/bin/hadoop classpath --glob)
export LD_LIBRARY_PATH=${HADOOP_ROOT}/lib/native:${JVM_ROOT}/jre/lib/amd64/server/
CFLAGS = -O2 -g -Wall -fmessage-length=0 -I${HADOOP_ROOT}/include
OBJS = hello.o
@leoncamel
leoncamel / janus-subscriber-example.md
Created May 9, 2019 12:39
janus subscriber example

create

  • POST
{
    "janus":"create",
@leoncamel
leoncamel / webrtc.rst
Last active May 18, 2019 14:22 — forked from voluntas/webrtc.rst
WebRTC 資料まとめ
From e465847873fdb54de7bc834c2d3d78639b98427a Mon Sep 17 00:00:00 2001
From: Matthew Waters <matthew@centricular.com>
Date: Tue, 31 Jan 2017 20:56:59 +1100
Subject: [PATCH] webrtcbin: an element that handles the transport aspects of
webrtc connections
SDP's are generated and consumed according to the W3C PeerConnection API
available from https://www.w3.org/TR/webrtc/
The SDP is either created initially from the connected
package main
import (
"fmt"
"os/exec"
"time"
)
func main() {
cmd := exec.Command("sleep", "1024")