Skip to content

Instantly share code, notes, and snippets.

View bcho's full-sized avatar
💍
一起来发财吧!Let's make some money!

hbc bcho

💍
一起来发财吧!Let's make some money!
View GitHub Profile
@bcho
bcho / rc.xml
Created July 16, 2012 12:41
rc.xml
<?xml version="1.0"?>
<openbox_config xmlns="http://openbox.org/3.4/rc">
<resistance>
<strength>10</strength>
<screen_edge_strength>20</screen_edge_strength>
</resistance>
<focus>
<focusNew>yes</focusNew>
<!-- always try to focus new windows when they appear. other rules do
apply -->
@bcho
bcho / guardfile.py
Created July 19, 2012 13:07
Guardfile
#!/usr/bin/env python2
from os.path import join
from livereload.task import Task
from livereload.compiler import lessc
static = 'static'
def _add_css():
@bcho
bcho / average_image_color.py
Created July 22, 2012 04:48 — forked from olooney/average_image_color.py
Average Image Color
from PIL import Image
def average_image_color(filename):
i = Image.open(filename)
h = i.histogram()
# split into red, green, blue
r = h[0:256]
g = h[256:256*2]
b = h[256*2: 256*3]
@bcho
bcho / Hover-Box
Created July 26, 2012 12:29 — forked from Kaiyuan/Hover-Box.html
Hover-Box
<div class="box">
<img class="image" src="https://dl.dropbox.com/u/6450050/demo/music-player-air/images/359167072-1.jpg" alt="">
<div class="text">
<h2>title</h2>
<p>This's Photo.</p>
</div>
</div>
<style type="text/css">
.box {
width: 100px;
#coding: utf-8
from color import _color_quantization
from color import _save_image, _get_hex_palette
from color import image
cq = _color_quantization(image, 8)
_save_image(cq, 'cq.png')
cq_palette = _get_hex_palette(cq, 8)
#coding: utf-8
# these code are from [ColorMeta](https://github.com/bcho/colormeta)
from PIL import Image
def rgb2xyz(r, g, b):
# RGB to CIE XYZ REC 709
# http://www.easyrgb.com/index.php?X=MATH&H=02#text2
def _rgb(c):
#coding: utf-8
from user_other_settings import an_user_gave_filter_which_always_returns_foo
# liquidluck meta
liquidluck = {
'source': 'content',
'output': 'deploy',
'static_output': 'deploy/static',
<?xml version="1.0"?>
<openerp>
<data>
<record model="ir.ui.view" id="view_email_server_form_inherit">
<field name="name">email.server.form.inherit</field>
<field name="model">email.server</field>
<field name="type">form</field>
<field ref="fetchmail.view_email_server_form" name="inherit_id" />
<field name="arch" type="xml">
<form string="POP/IMAP Server">
#coding: utf-8
{
'name': 'claim and support',
'version': '0.0.1',
'author': 'hbc',
'website': '',
'category': 'Cutomised Modules',
'depends': [
'mail_gateway'
@bcho
bcho / elimination.py
Created September 22, 2012 10:42
readme
#coding: utf-8
'''Solving system of linear equations with Gauss-Jordan elimination'''
from frac import Frac
class Equation(list):
def reduce_n(self, n):
'''Reduce the nth element to 1'''