Skip to content

Instantly share code, notes, and snippets.

View xonge's full-sized avatar

陆小凤 xonge

  • 长沙微动信息
  • 长沙
View GitHub Profile
@xonge
xonge / 0_reuse_code.js
Last active August 29, 2015 14:14
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@xonge
xonge / nl2p.php
Created May 28, 2015 06:25
php:nl2p
function nl2p($text) {
return "<p>" . str_replace("\n", "</p><p>", $text) . "</p>";
}
@xonge
xonge / MobileNameCards.aspx
Created June 3, 2015 02:55
js获得当前时间戳
var ts = (new Date()).getTime();
@xonge
xonge / MobileNameCards.aspx
Created June 3, 2015 02:56
微名片js提交错误
<script type="text/javascript">
$("link").each(function() {
var $this = $(this);
var url = $this.attr("href");
var ts = (new Date()).getTime();
$this.on("error",
function() {
$this.attr("href", url + "?=" + ts);
});
});
@xonge
xonge / MobileNameCards.aspx
Created June 3, 2015 02:57
微名片html片段
<input id="isFocus" type="hidden" value="false" data-url="test" />
<input id="hasCollect" type="hidden" value="false" />
<input id="personId" type="hidden" value="54fc508f0cf2edf0d9e1cc6c" />
<input id="openId" type="hidden" value="od8J4s8lK2OleSGuj9QCER6912Q4"
/>
<input id="focusUrl" type="hidden" value="" />
<input id="fromUrl" type="hidden" value="" />
<input id="isFirst" type="hidden" value="" />
<input id="showTip" type="hidden" value="" />
<input id="notWeixin" type="hidden" value="" />
@xonge
xonge / MobileNameCards.aspx
Created June 3, 2015 03:00
微名片分享菜单
<!-- 分享菜单-->
<div class="sharetip sharetip-cfriend js-sharetip-cfriend">
<div class="shareBox">
<span class="shareBox-title">
分享到:
</span>
<div class="bdsharebuttonbox clearfix" data-tag="share_1">
<a class="bds_sqq" data-cmd="sqq">
QQ好友
</a>
@xonge
xonge / MobileNameCards.aspx
Created June 3, 2015 03:02
微名片箭头
<!-- 箭头-->
<div class="fuckarr" style="display:<%= StrShowMerchantUserName == StrMerchantModelUserName ? "" : "none"%>;">
<img alt="" src="CardImages/nav.gif" />
</div>
@xonge
xonge / MobileNameCards.aspx
Created June 3, 2015 09:20
想要学习的js写法
<script type="text/javascript">
var _system={
$:function(id){
return document.getElementById(id);
},
_client:function(){
return {w:document.documentElement.scrollWidth,h:document.documentElement.scrollHeight,bw:document.documentElement.clientWidth,bh:document.documentElement.clientHeight};
},
_scroll:function(){
return {x:document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft,y:document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop};
@xonge
xonge / CommonUtil.php
Created June 5, 2015 03:00
判断是否为空
static function trimString($value){
$ret = null;
if (null != $value) {
$ret = $value;
if (strlen($ret) == 0) {
$ret = null;
}
}
return $ret;
}
@xonge
xonge / WechatAddFriend.aspx
Created June 5, 2015 03:14
微信获得公众号的二维码
http://open.weixin.qq.com/qr/code/?username=