Skip to content

Instantly share code, notes, and snippets.

@oblank
oblank / Dockerfile
Created January 27, 2016 10:39
nginx php mysql redis memcached mongodb
#vim:set ft=dockerfile:
FROM centos:latest
MAINTAINER oBlank <dyh1919@gmail.com>
# Add the ngix and PHP dependent repository
ADD ./files/nginx.repo /etc/yum.repos.d/nginx.repo
# Installing nginx
RUN yum -y install nginx perl
@oblank
oblank / TodoConstants.js
Created January 27, 2016 08:01
javascript constants 定义
/*
* Copyright (c) 2014-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* TodoConstants
*/
#main ::-webkit-scrollbar {
height: 5px;
width: 5px;
-webkit-border-radius: 5px;
}
#main ::-webkit-scrollbar-thumb {
background: #c1c1c1;
-webkit-border-radius: 5px;
}
#main ::-webkit-scrollbar-track {
@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;
@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 / 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() {
/*
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 / 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
@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 / 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