Skip to content

Instantly share code, notes, and snippets.

@congjf
congjf / ExecuteTemplate.go
Last active December 28, 2015 17:49
ExecuteTemplate
func hello(ctx *web.Context) {
err := templates.ExecuteTemplate(ctx.ResponseWriter, "index.html", "no needed data")
if err != nil {
panic(err.Error())
}
}
func main() {
web.Get("/", hello)
web.Run("0.0.0.0:9990")
@congjf
congjf / static_file_mux.go
Created November 21, 2013 07:33
static files routes in mux.go
package main
import (
// native packages
"net/http"
// third packages
"github.com/gorilla/mux" // for router
)
@congjf
congjf / .Title
Last active December 30, 2015 03:19 — forked from lotem/default.custom.yaml
鼠须管配置信息
鼠须管配置信息
# 適用於【鼠鬚管】0.9.13+
# 位置:~/Library/Rime/squirrel.custom.yaml
# 用法:想要哪項生效,就刪去該行行首的#字符,但注意保留用於縮進的空格
patch:
# us_keyboard_layout: true # 鍵盤選項:應用美式鍵盤佈局
# show_notifications_when: growl_is_running # 狀態通知,默認裝有Growl時顯示,也可設爲全開(always)全關(never)
# style/horizontal: true # 候選窗横向顯示
# style/font_face: "儷黑 Pro" # 我喜歡的字體名稱
# style/font_point: 21 # 字號
@congjf
congjf / modal.html
Created December 5, 2013 01:41
Using Modal from Bootstrap
<script src="lib/jquery/jquery.js"></script>
<script src="lib/bootstrap/bootstrap.js"></script>
<!-- Button -->
<button class="btn btn-default" data-toggle="modal" data-target="#AddSection">添加部门</button>
<!-- Modal -->
<div class="modal fade" id="AddSection" role="dialog" aria-labelledby="AddSection" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
@congjf
congjf / HTML_Check_All.name
Last active December 30, 2015 07:59
Check all Checkbox
HTML, Check all the Checkbox!
@congjf
congjf / Angular_Service_Samples.js
Created December 5, 2013 08:10
Angular Service Samples
/**
* batchLog service allows for messages to be queued in memory and flushed
* to the console.log every 50 seconds.
*
* @param {*} message Message to be logged.
*/
function batchLogModule([$provide](http://docs.angularjs.org/api/AUTO.$provide)){
$provide.factory('batchLog', ['$timeout', '$log', function($timeout, $log) {
var messageQueue = [];
@congjf
congjf / Angular_Service_$inject.js
Created December 5, 2013 08:11
Angular $inject Service
function myModuleCfgFn($provide) {
var myServiceFactory = function(dep1, dep2) {};
myServiceFactory.$inject = ['dep1', 'dep2'];
$provide.factory('myService', myServiceFactory);
}
@congjf
congjf / .Title
Last active December 30, 2015 08:19
Angular Service Dependence
Angular Service Dependence
@congjf
congjf / .angular_service_register.title
Last active December 30, 2015 08:19
Angular Service Register
AngularJS Service Register