Skip to content

Instantly share code, notes, and snippets.

View rankun203's full-sized avatar
🔨
building things

Kun R rankun203

🔨
building things
View GitHub Profile
@rponte
rponte / gist:1332286
Created November 1, 2011 23:39
Spring Advice: autowiring interface types rather than class types
There's another good reason to autowire interface types rather than class types, which is that if Spring needs
to generate a proxy object around the bean before injecting it, then if the bean's class defines any
interfaces, then the proxy will implement those interfaces, and will not be type-compatible with the bean class
itself. If you then try and autowire that bean by class type, it will fail. The easiest way to avoid this
annoying scenario is to always autowire by interface type, that way it will lways work as you expect.
http://stackoverflow.com/questions/5288153/using-spring-to-wire-directly-a-concrete-class
@rankun203
rankun203 / WeatherController.java
Created October 28, 2013 07:40
Java attach http proxy
//attach http proxy
System.setProperty("http.proxyHost", "127.0.0.1");
System.setProperty("http.proxyPort", "8087");
$(function () {
$('#exercise-stat-chart-2').highcharts({
title: {
text: ''
},
xAxis: {
title: {
text: '课次'
},
allowDecimals: false,

#一些互联网使用方法 ###目录:

  1. youtube下载视频(包括1080p).
  2. 翻墙.
  3. 不翻墙使用Google Search.
  4. 关于本文.
  5. 解释

###youtube下载视频

ufop.yaml 编写指南

描述

ufop的创建方式是需要把一个叫ufop.yaml的文件和资源文件放在一个目录下,ufop.yaml中包含创建的基础镜像,创建脚本,运行命令的行为, 服务端会根据这些创建对应的镜像。

ufop.yaml规则

@tganzarolli
tganzarolli / CorsPreFlightService
Created January 20, 2014 14:25
A RestEasy service to return a default OK response for a CORS pre-flight request. Those requests are made when you are using CORS along with authentication headers. Using Jetty, the org.eclipse.jetty.servlets.CrossOriginFilter configured on the web.xml can take care of sending the required headers on the response. However, it does not care of re…
import javax.ws.rs.OPTIONS;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import org.springframework.stereotype.Service;
@Produces(MediaType.APPLICATION_JSON)
@Path("/")
[options]
module.name_mapper='^\(.*\)\.css$' -> '<PROJECT_ROOT>/CSSModule.js.flow'
[libs]
CSSModule.js.flow
@XadillaX
XadillaX / require.js
Created November 27, 2015 05:25
Hack require demo
"use strict";
var fs = require("fs");
var path = require("path");
var Module = require("module");
var _resolveFilename = Module._resolveFilename.bind(Module);
var cache = {};
var SRC_PATH = path.resolve(__dirname, "../");
@mike-lawrence
mike-lawrence / opencv.py
Created May 7, 2012 16:30
comparing openCV vs SimpleCV capture performance
import cv
import time
tolerance = 2
webcam_stream = cv.CaptureFromCAM(0)
print cv.GetCaptureProperty(webcam_stream,cv.CV_CAP_PROP_FPS)
print cv.GetCaptureProperty(webcam_stream,cv.CV_CAP_PROP_FRAME_WIDTH)
print cv.GetCaptureProperty(webcam_stream,cv.CV_CAP_PROP_FRAME_HEIGHT)