Skip to content

Instantly share code, notes, and snippets.

@oblank
oblank / home.html
Last active August 29, 2015 14:23 — forked from pinscript/home.html
{{define "body"}}
This is the start page.
<br><br>
Check out <a href="/user/5">user 5</a> or <a href="/user/7">user 7</a>.
{{end}}
@oblank
oblank / generate_pdf.php
Created July 29, 2015 08:59
利用 wkhtmltopdf 将html转换成 pdf
$html = '<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head>
<body>'.$html.'</body>
</html>';
//echo $html;
//将本地 HTML 文件转为 PDF
// Run wkhtmltopdf
@oblank
oblank / bleve_with_jieba.go
Last active May 14, 2024 15:57
bleve结合 jieba 分词实现中文分词
package main
import (
"fmt"
"github.com/blevesearch/bleve"
_ "github.com/wangbin/jiebago/analyse/tokenizers"
"log"
)
func main() {
@oblank
oblank / surge.conf
Created October 11, 2015 07:51 — forked from soffchen/surge.conf
surge.conf
[General]
loglevel = notify
all-tcp-mode = false
[Proxy]
Proxy = custom
[Rule]
// iOS
DOMAIN-SUFFIX,lcdn-registration.apple.com,DIRECT
@oblank
oblank / index.js
Created October 12, 2015 08:45
nodejs cluster
/**
* Created by oBlank on 10/12/15.
*/
var cluster = require('cluster');
var http = require('http');
var numCPUs = require('os').cpus().length;
var timeouts = [];
function errorMsg() {
@oblank
oblank / 0_reuse_code.js
Created October 23, 2015 10:09
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
/*
Package goevent is event dispatcher.
Listen for event:
e := goevent.New()
e.On(func(i int, s string){
fmt.Printf("%d: %s\n", i, s)
})
Trigger:
e.Trigger(1, "foo")
Use event table:
@oblank
oblank / index.js
Created November 24, 2015 07:27
nodejs cluster test script
/**
* Created by oBlank on 10/12/15.
*/
var cluster = require('cluster');
var http = require('http');
var numCPUs = require('os').cpus().length;
var timeouts = [];
function errorMsg() {
@oblank
oblank / index.html
Created November 24, 2015 10:49
ajax and history pushstate
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>test ajax and push state</title>
<script src="http://libs.baidu.com/jquery/1.9.0/jquery.js"></script>
</head>
<body>
<ul>
<li><a data-id="1" href="javascript:;">访问1</a></li>
@oblank
oblank / scrollbar.html
Created November 25, 2015 09:35
custom scrollbar like goolge map
<style type="text/css">
.scrollable-x,.scrollable-y {
outline-offset:-2px;
/*padding-right: 6px;*/
overflow-x:hidden;
overflow-y:hidden;
}
.scrollable-y.scrollable-show,.scrollable-y:focus,.scrollable-y:hover,.scrollable-show-all .scrollable-y {
overflow-y:auto;