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 / phpexcel_style_and_data
Created September 21, 2012 07:14
phpexcel set border
// set border
$sheet->getStyle("A1:I{$offset}")->applyFromArray(array(
'borders' => array(
'allborders' => array(
'style' => PHPExcel_Style_Border::BORDER_THIN
)
)
));
@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 / 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 / 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 / export_image_to_excel
Created August 3, 2012 01:02
Exprot Online Image to Excel by PHPExcel
<?php
require_once __DIR__ . '/PHPExcel/Classes/PHPExcel.php';
$objPHPExcel = new PHPExcel();
// imagecreatefromXXX (XXX is jpeg png or gif)
$gdImage = imagecreatefromjpeg('http://678bt.com/PHPExcel/Tests/images/officelogo.jpg');
$objDrawing = new PHPExcel_Worksheet_MemoryDrawing();
@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