Skip to content

Instantly share code, notes, and snippets.

@wgm89
wgm89 / simulate.py
Last active October 23, 2019 01:56
python simulate keybord
import ctypes
LONG = ctypes.c_long
DWORD = ctypes.c_ulong
ULONG_PTR = ctypes.POINTER(DWORD)
WORD = ctypes.c_ushort
class MOUSEINPUT(ctypes.Structure):
_fields_ = (('dx', LONG),
('dy', LONG),
#!/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) {
@wgm89
wgm89 / gist:5942191
Created July 7, 2013 03:42
slim nginx rewrite
server {
listen 80;
root /var/www/slim;
index index.html index.htm index.php;
# Make site accessible from http://localhost/
#
server_name test.com;
if (!-f $request_filename) {
实时的分布式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:51b880a32323e3722be2
Created June 19, 2014 10:44
encrypt , decrypt
<?php
class encrypt
{
private $key;
private $uword;
private $eword;
private $letters;
/**
@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>