Skip to content

Instantly share code, notes, and snippets.

View xiaocong's full-sized avatar
🐶
I may be slow to respond.

xiaocong xiaocong

🐶
I may be slow to respond.
View GitHub Profile
@xiaocong
xiaocong / # emacs-plus - 2016-10-03_11-20-23.txt
Created October 3, 2016 04:11
emacs-plus (d12frosted/emacs-plus/emacs-plus) on macOS 10.11.6 - Homebrew build logs
Homebrew build logs for d12frosted/emacs-plus/emacs-plus on macOS 10.11.6
Build date: 2016-10-03 11:20:23
@xiaocong
xiaocong / # emacs-plus - 2016-10-03_11-20-23.txt
Created October 3, 2016 03:41
emacs-plus (d12frosted/emacs-plus/emacs-plus) on macOS 10.11.6 - Homebrew build logs
Homebrew build logs for d12frosted/emacs-plus/emacs-plus on macOS 10.11.6
Build date: 2016-10-03 11:20:23
@xiaocong
xiaocong / crawl.py
Created September 24, 2016 17:49
python.head
#!/usr/bin/env python
# -*- coding: utf-8 -*-
for atom sync
@xiaocong
xiaocong / template.py
Created August 10, 2014 09:04
python header
#!/usr/bin/env python
# -*- coding: utf-8 -*-
@xiaocong
xiaocong / timezone.py
Created March 12, 2014 03:56
timezone_estimate
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (division, print_function, absolute_import,
unicode_literals)
__all__ = ["estimate_timezone"]
import re
import logging
@xiaocong
xiaocong / screenshot.sh
Created December 12, 2013 08:29
take screenshot on android
#!/bin/bash
adb pull /dev/graphics/fb0 fb0
dd bs=1920 count=800 if=fb0 of=fb0b
ffmpeg -vframes 1 -vcodec rawvideo -f rawvideo -pix_fmt rgb32 -s 480x800 -i fb0b -f image2 -vcodec png fb0.png
@xiaocong
xiaocong / gist:7767195
Created December 3, 2013 10:36 — forked from Mithrandir0x/gist:3639232
angular provider/service/factory
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
@xiaocong
xiaocong / gist:6988640
Created October 15, 2013 08:50 — forked from anjackson/gist:2888380
python proxy
import bottle
from wsgiproxy.app import WSGIProxyApp
# Remove "hop-by-hop" headers (as defined by RFC2613, Section 13)
# since they are not allowed by the WSGI standard.
FILTER_HEADERS = [
'Connection',
'Keep-Alive',
'Proxy-Authenticate',
'Proxy-Authorization',
@xiaocong
xiaocong / find_executable.py
Created August 14, 2013 01:31
python: find executable path
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
"""
import jsonrpclib
import os
import urllib2
import subprocess