Skip to content

Instantly share code, notes, and snippets.

import cv2
import numpy as np
canny = rho = threshold = minLen = maxGap = None
def draw():
lines = cv2.HoughLinesP(canny, rho, np.pi / 180,
threshold, None, minLen, maxGap)
dst = cv2.cvtColor(canny, cv2.COLOR_GRAY2BGR)
@fungxu
fungxu / App.java
Created March 27, 2016 14:54 — forked from thomasdarimont/App.java
Spring Boot Redis custom json serializer example.
package demo;
import java.io.Serializable;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisOperations;
@fungxu
fungxu / ReviewBoard_Dockerfile
Last active August 27, 2015 02:17 — forked from tchap/ReviewBoard_Dockerfile
Run Review Board inside of a Docker container.
# Run Review Board in a Docker container.
FROM ubuntu:latest
MAINTAINER Ondrej Kupka "ondra.cap@gmail.com"
# Get all packages we need
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN apt-get update
# Install Python
@fungxu
fungxu / day1.js
Last active August 29, 2015 14:24 — forked from auser/day1.js
angular service/factory/provider 的使用区别
angular.module('myApp.services', [])
//======================================== 定义 factory, 单例的
.factory('UserFactory', function($http, $q) {
var service = {
// our factory definition
user: {},
setName: function(newName) {
service.user['name'] = newName;
},
setEmail: function(newEmail) {
#!/bin/sh
echo 'deb http://archive.ubuntu.com/ubuntu precise main universe' > /etc/apt/sources.list
apt-get update
apt-get install -y mysql-server curl apache2 git-core php5 php5-mysql php5-curl php5-gd php5-mcrypt
#dpkg-divert --local --rename --add /sbin/initctl
#ln -s /bin/true /sbin/initctl
@fungxu
fungxu / README.md
Last active August 29, 2015 14:19 — forked from firejune/README.md

Add Secure with HTTP Authentication for Cloud9 IDE.

git clone https://github.com/ajaxorg/cloud9.git
git submodule update --init --recursive
git apply cloud9.patch
git clone git://github.com/semu/connect-basic-auth.git support/connect-basic-auth
node bin/cloud9.js -c config.js 

Open the url http://127.0.0.1:3000/ when prompt the authorization,username is "username" and password is "password".

@fungxu
fungxu / hack.sh
Created February 14, 2014 01:23 — forked from erikh/hack.sh
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
var mongoose = require('mongoose');
mongoose.connect('mongo://localhost/test');
var conn = mongoose.connection;
var users = conn.collection('users');
var channels = conn.collection('channels');
var articles = conn.collection('articles');
var insertUsers = Q.nfbind(users.insert.bind(users));
var insertChannels = Q.nfbind(channels.insert.bind(channels));