Skip to content

Instantly share code, notes, and snippets.

View outman's full-sized avatar
💭
I may be slow to respond.

outman

💭
I may be slow to respond.
  • Beijing, China
View GitHub Profile
@outman
outman / gist:a64860f83f011d707ed7
Last active August 29, 2015 14:20
vimrc unmap key
"""""""""""""""""""""""""""""""""
" https://github.com/amix/vimrc
"""""""""""""""""""""""""""""""""
set nu
set mouse=v
let g:NERDTreeWinPos = "left"
""""""""""""""""""""""""""""""""""
" => PHP section
@outman
outman / my_vim_config.vim
Created July 31, 2015 02:26
my_vim_config.vim
set nu
set mouse=v
let g:NERDTreeWinPos="left"
let g:NERDTreeWinSize=26
""""""""""""""""""""""""""""""""""
" => PHP section
""""""""""""""""""""""""""""""""""
@outman
outman / 12306AutoSubmit.user.js
Created January 9, 2012 07:49 — forked from kevintop/12306AutoSubmit.user.js
12306 Auto Submit
/*
12306 Auto Submit => A javascript snippet to help you auto submit.
Copyright (C) 2011 Kevintop
Includes jQuery
Copyright 2011, John Resig
Dual licensed under the MIT or GPL Version 2 licenses.
http://jquery.org/license
Includes 12306.user.js
@outman
outman / CSV_Exoprt
Created September 1, 2012 16:43
Export CSV Class
<?php
/**
* Base ON Zhen.liu's SourceCode
* Add isset function for user agent
* Change line end
*/
class CSV {
@outman
outman / codeigniter_rewrite_for_nginx
Created September 12, 2012 13:56
nginx for CodeIgniter rewrite
server {
listen 80;
server_name mrkt.com;
access_log /var/www/html/logs/mrkt.access.log main;
error_log /var/www/html/logs/mrkt.error.log;
location / {
root /var/www/html/mrkt;
index index.html index.htm index.php;
@outman
outman / split_chinese_by_space
Created September 13, 2012 09:20
Split Chinese String By Space To A New
$cn_string_split_by_space = implode(" ", preg_split('//u', "中文字符串", -1, PREG_SPLIT_NO_EMPTY));
@outman
outman / site domain
Created October 18, 2012 06:20
site domain
class Util {
static function domain($output = true) {
$protocol = strpos(strtolower($_SERVER['SERVER_PROTOCOL']),'https');
$host = $_SERVER["HTTP_HOST"];
$port = $_SERVER["SERVER_PORT"];
$domain = (($protocol !== false) ? "https" : "http") . "://" . $host;
$domain .= ($port == "80") ? "" : (":" . $port);
@outman
outman / zendframework2moduleroute
Created November 25, 2012 11:06
ZendFramework2 route for new module by segment
return array(
'controllers' => array(
'invokables' => array(
'Admin\Controller\Index' => 'Admin\Controller\IndexController',
'Admin\Controller\Dash' => 'Admin\Controller\DashController',
),
),
'router' => array(
@outman
outman / backtotop
Created November 26, 2012 01:25
back to top
$(document).ready(function(){
$("#back-top").hide();
$(function () {
$(window).scroll(function () {
if ($(this).scrollTop() > 100) {
$('#back-top').fadeIn();
} else {
$('#back-top').fadeOut();
}
@outman
outman / yaf_nginx.conf
Created July 23, 2013 12:43
php framework yaf with nginx & php-fpm
server {
set $htdocs /home/libaochang/data/orange/public;
listen 80;
server_name xmprs.com;
location / {
root $htdocs;
autoindex on;
index index.php index.html;
if (!-e $request_filename){