Skip to content

Instantly share code, notes, and snippets.

View mtmzorro's full-sized avatar
🌌
Warp Drive Active

mTmzorro mtmzorro

🌌
Warp Drive Active
View GitHub Profile
@mtmzorro
mtmzorro / cloudSettings
Last active September 14, 2020 04:28
Vscode Settings Sync
{"lastUpload":"2020-09-14T04:28:02.243Z","extensionVersion":"v3.4.3"}
@mtmzorro
mtmzorro / now.sh
Last active August 19, 2020 08:43
📚在读:2
🎵已听:3847
/*font*/
#main {
font-family: 'Microsoft Yahei','\5FAE\8F6F\96C5\9ED1','Hiragino Sans GB','\5B8B\4F53';
}
/*blockquote*/
blockquote {
border-left: 4px solid #ddd;
padding: 4px 15px;
color: #777;
@mtmzorro
mtmzorro / getQueryString.js
Created March 4, 2015 08:07
获取 url 参数
function getQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
if (r != null) return unescape(r[2]); return null;
}
@mtmzorro
mtmzorro / dir.md
Last active August 29, 2015 14:06
.
├── README.md //项目文件说明
├── css
│   ├── i   // UI层所用图片
│   │   └── x-ele.png
│   │   └── slice  //使用cssgaga所用文件夹待拼图 如果不用请忽略
│   │       └── menu_1.png
│   ├── sprite  //使用cssgaga所用文件夹生成文件 如果不用请忽略
│   │   └── menu.png
// 根据当前页面生成 QR code 的 bookmarklet
// 用到了 Google Chart API: https://developers.google.com/chart/infographics/docs/qr_codes?csw=1
javascript:(function(){document.location.href='https://chart.googleapis.com/chart?chs=150x150&cht=qr&choe=UTF-8&chl='+encodeURIComponent(document.location.href);})()
@mtmzorro
mtmzorro / adapt.js
Last active August 29, 2015 14:05 — forked from shenduxian1/adapt.js
//
if (navigator.userAgent.indexOf('Firefox') > 0 || window.navigator.msPointerEnabled) {
var head = document.getElementsByTagName('head');
var viewport = document.createElement('meta');
viewport.name = 'viewport';
viewport.id = 'viewport';
viewport.content = "width=640";
head.length > 0 && head[head.length - 1].appendChild(viewport);
$(window).resize(function () {
resizeWindow();
@mtmzorro
mtmzorro / arcWithRaphael.js
Last active August 29, 2015 14:03
creat a animate arc with Raphael.js
/**
* @demo http://jsfiddle.net/mtmzorro/TRLN6/1/
*
* thx genkilabs
* http://stackoverflow.com/questions/5061318/drawing-centered-arcs-in-raphael-js
*/
var arc = Raphael("canvas", 300, 300);
/**
/**
* [getElementsByClassName]
* @param {[String]} searchClass [searchClass]
* @param {[Object]} node [node document]
* @param {[String]} tag [html tag]
* @return {[Array]} [result]
*
* @from http://www.cnblogs.com/rubylouvre/archive/2009/07/24/1529640.html
*/
var getElementsByClassName = function(searchClass, node, tag) {
function resizeImage(oldImg, height){
var image = new Image();
image.src = oldImg.src;
var d = image.width / image.height;
var newWidth = height * d;
var newHeight = height;