Skip to content

Instantly share code, notes, and snippets.

<?php
include "app/config.php";
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="format-detection"content="telephone=no, email=no" />
<meta itemprop="name" content="<?=$wxData['title']?>"/>
<meta itemprop="image" content="<?=$wxData['imgUrl']?>" />
@southill
southill / vconsole.html
Created August 29, 2019 08:06
vconsole
<script src="https://cdn.jsdelivr.net/npm/vconsole@3.3.4/dist/vconsole.min.js"></script>
<script>
// 初始化
var vConsole = new VConsole();
console.log('Hello world');
</script>
@southill
southill / getImgColor.js
Last active January 14, 2019 01:36
get img color
function getImgColor(img) {
/**
* @ param 传入的图片
* @ this.progress 解析图片的进度 实时
* @ this.canvas canvas元素
* @ this.cvs context对象
* @ this.accuracy Number 解析图片颜色的精确度 1 - 7 数字选择
*
*
* @ anther taoqun <taoquns@foxmail.com>
@southill
southill / vconsole.js
Last active January 14, 2019 01:36
vconsole.js
<script src="https://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/vconsole/3.0.0/vconsole.min.js"></script>
<script>
var vConsole = new VConsole();
</script>
@southill
southill / hitTestObject.js
Last active January 14, 2019 01:36
hittest hit test
function hitTestObject(a,b){
var area_0 = [a.x,a.y,66,66];
var area_1 = [b.x,b.y,87,66];
return !(area_0[0] + area_0[2] < area_1[0]
|| area_0[0] > + area_1[0] + area_1[2]
|| area_0[1] + area_0[3] < area_1[1] || area_0[1] > + area_1[1]
+ area_1[3]);
}
@southill
southill / imagedata.js
Created December 5, 2017 09:36 — forked from colinbendell/imagedata.js
Extract a set of image information from a webpage
let imgData = Array.from(document.getElementsByTagName("img"))
.map(v => {
var rect = v.getBoundingClientRect();
var vHeight = (window.innerHeight || doc.documentElement.clientHeight);
var vWidth = (window.innerWidth || doc.documentElement.clientWidth);
var vDPR = window.devicePixelRatio;
return {
src: v.currentSrc,
cssWidth: v.clientWidth,
naturalWidth: v.naturalWidth,
@southill
southill / convert_giphy_gifs.sh
Created December 5, 2017 09:36 — forked from colinbendell/convert_giphy_gifs.sh
Simple mass conversion of GIF to MP4 (h264/h265), WebM (vp8/vp9) and WebP
#!/bin/sh
curl 'https://giphy.com/page/2?next=2017-12-01%2004%3A15%3A01&amp%3Bis=1&is=1&json=true' -o gipyurls.json
jq .[].gifs[].images.original.url gipyurls.json |cut -d / -f 5 | parallel -j 20 --gnu curl https://media2.giphy.com/media/{}/giphy.gif -o {}.gif
parallel -j 20 --gnu "ffmpeg -f gif -i {} {}.h264.mp4" ::: *.gif
parallel -j 20 --gnu "ffmpeg -f gif -i {} -c:v libx265 {}.h265.mp4" ::: *.gif
parallel -j 20 --gnu "ffmpeg -f gif -i {} -c:v libvpx {}.vp8.webm" ::: *.gif
parallel -j 20 --gnu "ffmpeg -f gif -i {} -c:v libvpx-vp9 {}.vp9.webm" ::: *.gif
@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;
@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 / onwechatpageshow.js
Last active June 30, 2017 07:05
解决微信内核为wkwebview时返回上一页界面不刷新的问题 onpageshow
window.onpageshow = function(event){
if (event.persisted) {
window.location.reload();
}
};