Skip to content

Instantly share code, notes, and snippets.

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

koolay koolay

🏠
Working from home
  • Mars
View GitHub Profile
using System.Web.Mvc;
namespace DemoApp.Areas.Demo
{
public class DemoAreaRegistration : AreaRegistration
{
public override string AreaName
{
get
{
@koolay
koolay / spider_lailaihui_com.py
Created May 19, 2014 16:19
crawl from lailaihui.com
#-*- coding:utf-8 -*-
#------------------------#
#requirement: peewee, requests, beautifulsoup4
#-------------------------#
import re, os
import datetime
import requests
import json, random
from bs4 import BeautifulSoup
@koolay
koolay / ajaxPager
Last active August 29, 2015 14:02
simple ajax paging
/* example:
Pager.argName = 'page';
Pager.jsonData = '';
Pager.pagerAppendToId = 'photo-paging';
Pager.pageSize = 16;
Pager.prefixUrl = "/api/LoadStoreImage?account="+account+"&shopId="+<%=MerchtId %> + "&pageSize=16";
Pager.showPageNumbers = 5;
Pager.callback = function(result){
var html = '';
var data = result.data;
@koolay
koolay / nginx-window-manager.bat
Created October 18, 2014 11:45
nginx windows 启动重启脚本
@echo off
rem 当前bat的作用
echo ==================begin========================
cls
SET NGINX_PATH=d:
SET NGINX_DIR=d:\nginx1.6\
color 0a
TITLE Nginx 管理程序
#! /bin/sh
### BEGIN INIT INFO
# Provides: supervisord
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
@koolay
koolay / facebook.js
Created May 12, 2014 09:16
facebook share
var Share = {};
Share.fb = function (link, title, sumary, image, winWidth, winHeight) {
var shareUrl = 'https://www.facebook.com/dialog/feed?';
shareUrl += 'app_id=141676832590601';
shareUrl += '&link=' + encodeURIComponent(link);
shareUrl += '&picture=' + encodeURIComponent(image);
shareUrl += '&name=' + title;
shareUrl += '&caption=' + "";
shareUrl += '&description=' + sumary;
@koolay
koolay / mongodbInstall
Last active July 5, 2016 07:13
install mongodb as windows service
#install as windows service
#---- config file: mongo.cfg ------
dbpath=D:\Program Files\mongodb\data
logpath=D:\Program Files\mongodb\log\mongo.log
logappend=true
bind_ip = 127.0.0.1
#---------------------------
@koolay
koolay / gist:dc43e7cd6e6109e30b5929e69e0d8f46
Created September 27, 2016 04:50 — forked from blalor/gist:c325d500818361e28daf
redhat init script for consul
#!/bin/bash
#
# consul Manage the consul agent
#
# chkconfig: 2345 95 95
# description: Consul is a tool for service discovery and configuration
# processname: consul
# config: /etc/consul.conf
# pidfile: /var/run/consul.pid
@koolay
koolay / setup.sh
Last active November 27, 2016 09:58 — forked from eduwass/setup.sh
Flynn Install : Single node ( for Ubuntu 14.04 x64 @ DigitalOcean droplet )
#!/bin/bash
# This script will automatically set up a single node Flynn Cluster on your linux box
# Fresh Flynn install with domain provided by the xip.io service
# Tested with Base Image: Ubuntu 14.04 x64 @ DigitalOcean droplet
# @date 16 Nov 2015
# @author Edu Wass (eduwass at gmail com)
echo '---- START SETUP ----'