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 / ci.py
Created April 3, 2019 12:37
双样本置信区间
import numpy as np
import scipy.stats as st
import random
apply_a = []
apply_b = []
## AB 两组人数各为 20000 人
for times in range(20000):
# AB 每组的报名次数
@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 / 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 / nginx conf php
Created December 13, 2013 07:46
nginx conf php
server {
listen 80;
server_name foo.com;
root /path;
index index.html index.htm index.php;
location / {
try_files $uri $uri/ /index.php;
}
@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){
@outman
outman / curl_post_file
Created December 6, 2012 07:26
upload file to server by curl post
Client
<?php
class HTTPClient {
function __construct($url, $port = 80)
{
$this->url = $url;
$this->port = $port;
}
@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 / 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 / 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 / phpexcel_data_for_phpmailer
Created September 21, 2012 07:17
phpexcel for phpmailer
// get the content
@ob_start();
$writer = PHPExcel_IOFactory::createWriter($excel, "Excel2007");
$writer->save("php://output");
$data = @ob_get_contents();
@ob_end_clean();
// set email attachment