Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
#=====================
while :
do
echo "Current DIR is " $PWD
stillRunning=$(ps -ef |grep "/data/wwwroot/lottery_v2/CORE/think auto" |grep -v "grep")
if [ "$stillRunning" ] ; then
echo "running..."
else
echo "restart ..."
@wgm89
wgm89 / search.php
Last active May 23, 2019 02:16
mysql实现简单分词搜索
<?php
//近期外包项目使用代码
//@author gm
function get_fenci($word) {
$word = preg_replace('/\s+/', ' ', trim($word));
$word_arr = explode(' ', $word);
$segments = array();
foreach ($word_arr as $word) {
实时的分布式sphinx索引配置及使用方法总结 coreseek文档:http://sphinxsearch.com/wiki/doku.php?id=sphinx_manual_chinese#需要的工具 需要更改/usr/local/coreseek/var/data 下的目录权限
安装开始:
cd /data/softwore
wget http://www.coreseek.cn/uploads/csft/4.0/coreseek-4.1-beta.tar.gz(只安装中文分词mmseg3)
tar zxvf coreseek-4.1-beta.tar.gz
cd coreseek-4.1-beta.tar.gz/
安装mmseg
$ cd mmseg-3.2.14 //根据具体的版本而定
$ ./bootstrap #输出的warning信息可以忽略,如果出现error则需要解决
javascript: (function () {
function c() {
var e = document.createElement("link");
e.setAttribute("type", "text/css");
e.setAttribute("rel", "stylesheet");
e.setAttribute("href", f);
e.setAttribute("class", l);
document.body.appendChild(e)
}
function h() {
@wgm89
wgm89 / git.migrate
Last active February 15, 2017 10:05 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@wgm89
wgm89 / git.migrate
Created February 15, 2017 10:04 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@wgm89
wgm89 / gist:23e8740fbe9221e174eb6de7598ebfc6
Created January 13, 2017 07:38 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@wgm89
wgm89 / object-watch.js
Created December 13, 2016 06:30 — forked from eligrey/object-watch.js
object.watch polyfill in ES5
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
@wgm89
wgm89 / jquery.ajaxqueue.js
Created December 13, 2016 06:30 — forked from extralam/jquery.ajaxqueue.js
jQuery AJAX queues
/*
:: Enhanced Version @extralam ::
Allows for ajax requests to be run synchronously in a queue , remove queue
Usage::
var queue = new $.AjaxQueue();
// add with tag name or not , both ok
queue.add('test',{
url: 'url',
@wgm89
wgm89 / vimrc.local
Created May 17, 2016 01:42
vim config
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required