Skip to content

Instantly share code, notes, and snippets.

@southill
southill / GetQueryString
Last active January 14, 2019 01:54
js获取地址参数
function GetQueryString(name){
var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if(r!=null)return unescape(r[2]); return null;
}
@southill
southill / imgLoadBeforeOnload.js
Created October 25, 2013 04:02
在图片onload之前获取图片的头部数据中的宽高
// 更新:
// 05.27: 1、保证回调执行顺序:error > ready > load;2、回调函数this指向img本身
// 04-02: 1、增加图片完全加载后的回调 2、提高性能
/**
* 图片头数据加载就绪事件 - 更快获取图片尺寸
* @version 2011.05.27
* @author TangBin
* @see http://www.planeart.cn/?p=1121
* @param {String} 图片路径
@southill
southill / nginx_vhost.conf
Created January 1, 2016 06:22
域名反向代理 #nginx #location #真实IP
location ^~ /
{
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://xxx.igumo.cc/;
}
@southill
southill / enableInlineVideo
Last active July 21, 2019 04:41
video inline
enableInlineVideo(document.querySelector('#thevideo'));
@southill
southill / jsconfig.js
Last active January 14, 2019 01:52
分享设置 #iwegu #jsconfig #wxjssdk
$.ajax({
type: "GET",
dataType: "jsonp",
url: "https://api.igumo.cc/api/wxcache/jsconfig",
data: {
url: location.href
},
success: function(_data) {
if (_data.status == 1) {
wx.config({
@southill
southill / input_file.html
Created April 11, 2016 16:44
input file with camera
.input_file {
@extend .full;
opacity 0;
}
<input type="file" class="input_file" accept="image/*" capture="camera">
@southill
southill / scrollbar.css
Created December 16, 2016 07:36
webkit scroll bar setting
::-webkit-scrollbar {
-webkit-appearance: none;
}
::-webkit-scrollbar:vertical {
width: 6px;
}
::-webkit-scrollbar:horizontal {
height: 12px;
@southill
southill / onwechatpageshow.js
Last active June 30, 2017 07:05
解决微信内核为wkwebview时返回上一页界面不刷新的问题 onpageshow
window.onpageshow = function(event){
if (event.persisted) {
window.location.reload();
}
};
@southill
southill / mhtml.php
Last active September 28, 2018 13:37
php2html.php
<?php
ob_start();
error_reporting(0);
require_once('../index.php');
$content = ob_get_contents();//取得php页面输出的全部内容
$fp = fopen("../index.html", "w");
fwrite($fp, $content);
fclose($fp);
header('Location:../index.html');
?>
@southill
southill / app.js
Created December 1, 2017 04:30
MyLottery With Fla Frame Step
function MyLottery(){
this.ems = new gm.EM;
}
MyLottery.prototype = {
init : function (_config) {
var self = this;
self.btnStart = _config.btnStart;
self.prizeBox = _config.prizeBox;
self.btnStart.addEventListener(annie.MouseEvent.CLICK, function () {
if( self.isRunning ) return;