Skip to content

Instantly share code, notes, and snippets.

View singleseeker's full-sized avatar

SingleSeeker singleseeker

View GitHub Profile
@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) {
[
{
id: 1,
img: "650b1406baf39292198e3ba5e1e71b06.jpg",
time: "1398766500",
title: "在线教育",
type: "microdata",
detail: {
id: "1",
title: "安居客梁伟平:是谁逼急了房产商",
@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);
//
// 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 / nginx
Created July 3, 2015 11:09
升级 ningx
#!/bin/bash
Install_Nginx()
{
Echo_Blue "[+] Installing ${Nginx_Ver}... "
groupadd www
useradd -s /sbin/nologin -g www www
Tar_Cd ${Nginx_Ver}.tar.gz ${Nginx_Ver}
./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_spdy_module --with-http_gzip_static_module --with-ipv6 --with-http_sub_module ${NginxMAOpt}
@singleseeker
singleseeker / .ignore
Created September 24, 2015 16:30
xcode ios project git ignore
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
## Build generated
build/
DerivedData
## Various settings
*.pbxuser
@singleseeker
singleseeker / gist:597be5fd01e3a10cad8a
Last active October 12, 2015 06:02
eloquent 用法
// ======================== Company.php ==========
class Company extends Model
{
protected $table = 'tbl_company';
protected $primaryKey = 'com_id';
public function company_invest_events()
{
return $this->hasMany('App\Models\Company_invest_events','invse_com_id','com_id')->with('invse_orags_list');
}
@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;
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 / 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