Skip to content

Instantly share code, notes, and snippets.

View wuliupo's full-sized avatar
🎯
Focusing: Jenkins, Vue, React

Pauli wuliupo

🎯
Focusing: Jenkins, Vue, React
View GitHub Profile
@wuliupo
wuliupo / lottery.html
Last active February 1, 2023 07:27
抽奖程序
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=gb2312"/>
<title>抽奖活动</title>
<style type="text/css">
body {padding-top:100px;font:12px "\5B8B\4F53",sans-serif;text-align:center;}
.result_box {margin:0 auto;width:700px;padding:100px 0;text-align:center;border:3px solid #40AA53;background:#efe;}
.result_box #oknum {width:680px;color:#cc0000;font-size:50pt;font-family:Verdana;text-align:center;border:none;background:#efe;}
.button_box {margin-top:50px;}
@wuliupo
wuliupo / redis.php
Created January 13, 2017 11:33
php-redis-on-windows
<?php
$host = 'test.kvstore.aliyuncs.com';
$port = 6379;
$user = 'username';
$pwd = 'password1234';
$key = 'the_stored_key';
$redis = new Redis();
if ($redis->connect($host, $port) == false) {
die($redis->getLastError());
@wuliupo
wuliupo / utils.js
Created October 24, 2016 08:35
Utilities
var utils = window.utils = {
random: function (min, max) {
min = min || 0;
max = max || 10000;
return Math.floor(Math.random() * (max - min + 1)) + min;
},
uuid: function (identifyNumber, options) {
var time = new Date().getTime(),
@wuliupo
wuliupo / weixin.php
Created June 30, 2017 02:31
微信公众平台开发接口PHP SDK完整版
<?php
/*
方倍工作室 http://www.fangbei.org/
CopyRight 2015 All Rights Reserved
http://www.cnblogs.com/txw1958/p/weixin-php-sdk.html
*/
define("TOKEN", "weixin");
$wechatObj = new wechatCallbackapiTest();
@wuliupo
wuliupo / second-hand-housing.html
Created August 5, 2017 06:39
二手房购买心得
<!DOCTYPE html>
<html>
<head>
<title>二手房买卖</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<style type="text/css">
body { font-family: 'Droid Serif'; }
h1, h2, h3 {
font-family: 'Yanone Kaffeesatz';
font-weight: normal;
@wuliupo
wuliupo / git-util.md
Last active June 12, 2017 10:21 — forked from lttlrck/gist:9628955
rename git branch locally and remotely

git branch -m old_branch new_branch         # Rename branch locally

git push origin :old_branch                 # Delete the old branch

git push --set-upstream origin new_branch   # Push the new branch, set local branch to track the new remote

git reset --hard HEAD                       # Revert (rolling back) to your current head point
@wuliupo
wuliupo / curry.js
Last active June 12, 2017 10:19
Currying-柯里化
/*
Curry(咖喱) 的概念很简单:只传递给函数一部分参数来调用它,让它返回一个函数去处理剩下的参数。
- 柯里化: http://baike.baidu.com/view/2804134.htm
- Currying: https://en.wikipedia.org/wiki/Currying
- Lodash: https://lodash.com/docs#curry
- Lodash-FP:https://github.com/lodash-archive/lodash-fp
- Ramda:http://ramdajs.com/
*/
function match(what) {
@wuliupo
wuliupo / functional.js
Last active June 12, 2017 10:17
Functional programming
// the functional programming version
const find2 = (f => f(f))(f =>
(next => (x, y, i = 0) =>
(i >= x.length) ? null :
(x[i] === y) ? i :
next(x, y, i+1))((...args) =>
(f(f))(...args)));
let arr = [0, 1, 2, 3];
console.log(find2(arr, 2));
@wuliupo
wuliupo / guaguaka.htm
Created May 6, 2017 16:50
刮刮卡事件
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>刮刮卡</title>
<style type="text/css">
h1 {
text-align: center;
}
@wuliupo
wuliupo / weinxin.php
Created May 5, 2017 05:18
WeixinController base in ThinkPHP
<?php
namespace Home\Controller;
use Common\Controller\CommonController;
class WeixinController extends CommonController{
private $appid;
private $appsecret;
public function _initialize(){
//第1步 appid, appsecret
$this->checkConfig('appid');
$this->checkConfig('appsecret');