Skip to content

Instantly share code, notes, and snippets.

View xonge's full-sized avatar

陆小凤 xonge

  • 长沙微动信息
  • 长沙
View GitHub Profile
@xonge
xonge / xgwx.js
Created June 9, 2015 09:18
微信版本比较函数
//微信版本比较函数
var versioncompare = function(curver, targetver){
if (curver === null || targetver === null) {
return false;
}
//这里使用没有过滤.的字符串,纯数字不好比较
var curverarr = curver.split('.');
var targetverarr = targetver.split('.');
console.log("current version number array is: " + curverarr);
for (var i = 0; i < curverarr.length; i++) {
@xonge
xonge / QzoneController.class.php
Created June 7, 2015 08:12
php通用函数 curl_get v1.0
// 通用函数 curl_get v1.0
function curl_get($url, $vars, $second = 30, $aHeader = array()) {
$ch = curl_init();
//超时时间
curl_setopt($ch, CURLOPT_TIMEOUT, $second);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//这里设置代理,如果有的话
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
@xonge
xonge / oauth2.php
Created June 6, 2015 09:29
php获得本机ip
$client_ip = gethostbyname($_ENV['COMPUTERNAME']);
@xonge
xonge / theme.css
Created June 6, 2015 06:56
搜企的iconfont
http://mp.soqi.cn/themes/common/fonts/common-icons/iconfont.eot /* IE9*/ /* IE6-IE8 */
http://mp.soqi.cn/themes/common/fonts/common-icons/iconfont.woff /* chrome、firefox */
/* chrome、firefox、opera、Safari, Android, iOS 4.2+*/
http://mp.soqi.cn/themes/common/fonts/common-icons/iconfont.ttf
http://mp.soqi.cn/themes/common/fonts/common-icons/iconfont.svg /* iOS 4.1- */
@xonge
xonge / WechatAddFriend.aspx
Created June 5, 2015 05:32
js打开窗口
var opened = window.open('http://open.weixin.qq.com/qr/code/?username=<%= StrWeChatCode%>', '_self');
opened.opener = null;
opened.close();
@xonge
xonge / WechatAddFriend.aspx
Created June 5, 2015 05:21
微信一键关注,6.2无效
weixin://contacts/profile/<%= StrWeChatCode%>
@xonge
xonge / WechatAddFriend.aspx
Created June 5, 2015 03:14
微信获得公众号的二维码
http://open.weixin.qq.com/qr/code/?username=
@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 / 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 / MobileNameCards.aspx
Created June 3, 2015 03:02
微名片箭头
<!-- 箭头-->
<div class="fuckarr" style="display:<%= StrShowMerchantUserName == StrMerchantModelUserName ? "" : "none"%>;">
<img alt="" src="CardImages/nav.gif" />
</div>