Skip to content

Instantly share code, notes, and snippets.

View summic's full-sized avatar
🏠
Working from home

Allen summic

🏠
Working from home
View GitHub Profile
@summic
summic / dict.scpt
Created February 23, 2010 09:52
Dict Action for QuickSilver
-- Dict Action for QuickSilver
--
-- Created by Summer Wang
-- Copyright (c) 2010 Summic, inc. All rights reserved.
--
using terms from application "Quicksilver"
on process text keyword
if keyword = "" then
@summic
summic / vimrc
Created March 8, 2010 09:53
vim配置文件
" Summer's Configuration file for vim based on hongbo's share
" Email:summer@snakr.com
" Blog: http://summic.com
set modelines=0 " CVE-2007-2438
" Normally we use vim-extensions. If you want true vi-compatibility
" remove change the following statements
set nocompatible " Use Vim defaults instead of 100% vi compatibility
set backspace=2 " more powerful backspacing
@summic
summic / vhostGen.sh
Created March 12, 2010 08:46
快速添加虚拟主机脚本
#! /bin/bash
#
# =======================
# Snow Leopard 创建虚拟主机脚本
# Written by Summer Wang <hi@summic.com>
# Blog: http://summic.com
# Created: feb 21 2010
# =======================
function make_web_dir
@summic
summic / gist:537024
Created August 19, 2010 04:22 — forked from traviskroberts/gist:46569
SVN 批量添加、删除脚本
alias add_all="svn st | grep '^\?' | awk '{print \$2}' | xargs svn add"
alias rm_all="svn st | grep '^\!' | awk '{print \$2}' | xargs svn rm"
@summic
summic / gist:723116
Created December 1, 2010 07:33
upload.php
<?php
/*
* 图片上传处理
* todo: 防止post大量图片攻击
*/
ini_set('gd.jpeg_ignore_warning', 1);
$config=array();
@summic
summic / gist:1022971
Created June 13, 2011 15:20
commentModel
<?php
//日记操作类
class commentModel{
function __construct(){
global $db,$user,$IN;
$this->db = $db;
$this->user = $user;
$this->input = $IN;
<?php
if (! isset($argv[1])) {
echo "enter a search term:\n";
echo 'php ' . __FILE__ . " <search_term>\n";
exit;
}
$term = urlencode($argv[1]);
$url = "http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStoreServices.woa/wa/wsSearch?limit=10&entity=software&term=$term";
@summic
summic / gist:1321925
Created October 28, 2011 09:11 — forked from anonymous/gist:887026
reverse proxy for tumblr
upstream tumblr {
server 72.32.231.8:80;
}
server {
listen 80;
server_name jyorr.com;
access_log /var/log/nginx/jyorr.access.log;
@summic
summic / release.sh
Created January 7, 2012 04:01
makes a release of a xcode project compatible with Sparkle
#!/bin/sh
########################################################################
# release.sh
#
# - makes a release of a xcode project compatible with Sparkle
# - makes the release in the diectory from which it were executed
#
########################################################################
# configuration
view:
<input name="data[datetime][]" value="">
<input name="data[address][]" value="">
Model
<?php
function add($data,$datainfo){
if ($this->db->insert($this->table_name, $data)) {
$oid = $this->db->insert_id();