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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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;} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'); |
NewerOlder