Skip to content

Instantly share code, notes, and snippets.

View singleseeker's full-sized avatar

SingleSeeker singleseeker

View GitHub Profile
//
// ToDoListTableViewController.m
// GettingStarted
//
// Created by seeker single on 6/16/15.
// Copyright (c) 2015 GettingStarted.com. All rights reserved.
//
#import "ToDoListTableViewController.h"
#import "ToDoItem.h"
@singleseeker
singleseeker / create_image_by_php.php
Last active August 29, 2015 14:05
create image useing php
// Create the image
$im = imagecreatetruecolor(40, 40);
// Create some colors
$white = imagecolorallocate($im, 255, 255, 255);
// Set background
$rand_color= imagecolorallocate($im, rand(0,220), rand(0,220), rand(0,220));
imagefill($im, 0, 0,$rand_color);
[
{
id: 1,
img: "650b1406baf39292198e3ba5e1e71b06.jpg",
time: "1398766500",
title: "在线教育",
type: "microdata",
detail: {
id: "1",
title: "安居客梁伟平:是谁逼急了房产商",
@singleseeker
singleseeker / Gruntfile.js
Created April 26, 2014 03:03
yeoman configue file
// Generated on 2014-03-31 using generator-webapp 0.4.7
'use strict';
// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'
module.exports = function (grunt) {
@singleseeker
singleseeker / vhost
Created January 11, 2014 07:09
http-vhost.conf
<VirtualHost *:80>
ServerAdmin seeker@v2.chuang86.com
DocumentRoot "/Users/seeker/vhost/chuang86"
ServerName www.v2.chuang86.com
ServerAlias v2.chuang86.com
ErrorLog "/private/var/log/apache2/v2.chuang86.com-error_log"
CustomLog "/private/var/log/apache2/v2.chuang86.com-access_log" common
<Directory "/Users/seeker/vhost/chuang86">
Options Indexes FollowSymLinks
@singleseeker
singleseeker / backup.sh
Last active December 28, 2015 09:19
back up server or local file, also could used with mysql dump
#!/bin/bash
#Backup name
if [ -n "$1" ]; then
BACKUP_NAME=$1 # Name of backup (log file, dest dir, exclude)
else
exit 1
fi
# Optional hostname
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `tbl_city`
-- ----------------------------
DROP TABLE IF EXISTS `tbl_city`;
CREATE TABLE `tbl_city` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`city_id` int(11) DEFAULT NULL,
`city_name` varchar(100) DEFAULT NULL,
@singleseeker
singleseeker / www.xxx.com
Created November 19, 2012 04:03
ngnix::conf-domain
log_format www.{{yoursiteurl}}.com '$remote_addr - $remote_user [$time_local] $request '
'$status $body_bytes_sent $http_referer '
'$http_user_agent $http_x_forwarded_for';
server
{
listen 80;
server_name www.{{yoursiteurl}}.com {{yoursiteurl}}.com;
index index.html index.htm index.php default.html default.htm default.php;
root /home/wwwroot/www.{{yoursiteurl}}.com;
@singleseeker
singleseeker / sessions.php
Created November 19, 2012 04:00
codeigniter::KNDB-session
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
* Code Igniter
*
* An open source application development framework for PHP 4.3.2 or newer
*
* @package CodeIgniter
* @author Elise Bosse
* @copyright Copyright (c) 2008, E.Bosse
* @license http://www.codeignitor.com/user_guide/license.html