Skip to content

Instantly share code, notes, and snippets.

View Jeff2Ma's full-sized avatar

Jeff Ma Jeff2Ma

View GitHub Profile
@imdong
imdong / apple.js
Last active October 24, 2024 06:09
/**
* Apple Store 专卖店库存监控
*
* Docker:
* 前台运行 $ docker run --rm -it -v $(pwd):/app --name="apple" node:alpine node /app/apple.js
* 后台运行 $ docker run --rm -it -d -v $(pwd):/app --name="apple" node:alpine node /app/apple.js
* 后台时实时查看日志 $ docker logs -f -n 100 apple
*
* 需先: npm i axios
*
var CryptoJS = require('crypto-js')
var request = require('request-promise')
/*
* npm install crypto-js request-promise request
* node wx_t1t_hack.js
*/
// export function testEncription(msg, fullKey) {
// var fullKey = fullKey.slice(0, 16)
@lgmcolin
lgmcolin / phoneCollector_1
Last active January 1, 2016 12:29
移动端代码片段mark
/*
* 1. media query
* 2. meta标签
* 3. link标签
* 4. retina解决方案
* 5. 判断手机或平板
* 6. 关闭自动大写与自动修正
* 7. 被点击元素外观变化,可以通过样式来设定
* 8. 阻止旋转屏幕是自动调整字体大小
**/
@larrybotha
larrybotha / A.markdown
Last active February 7, 2024 15:20
Fix SVGs not scaling in IE9, IE10, and IE11

Fix SVG in <img> tags not scaling in IE9, IE10, IE11

IE9, IE10, and IE11 don't properly scale SVG files added with img tags when viewBox, width and height attributes are specified. View this codepen on the different browsers.

Image heights will not scale when the images are inside containers narrower than image widths. This can be resolved in 2 ways.

Use sed in bash to remove width and height attributes in SVG files

As per this answer on Stackoverflow, the issue can be resolved by removing just the width and height attributes.

@aliencode
aliencode / handlebar.md
Created June 28, 2013 02:24
handlebar 方法参考文档

handlebar 方法参考文档

介绍

Handlebars是JavaScript一个语义模板库,通过对view和data的分离来快速构建Web模板。它采用"Logic-less template"(无逻辑模版)的思路,在加载时被预编译,而不是到了客户端执行到代码时再去编译, 这样可以保证模板加载和运行的速度。Handlebars兼容Mustache,你可以在Handlebars中导入Mustache模板。

使用与安装

Handlebars的安装非常简单,你只需要从Github下载最新版本,你也可访问下面网址获取最新信息:http://handlebarsjs.com。 目前handlebars.js已经被许多项目广泛使用了,handlebars是一个纯JS库,因此你可以像使用其他JS脚本一样用script标签来包含handlebars.js

@uranusjr
uranusjr / Connect.scpt
Created October 16, 2012 21:58
Connect to specified SSID via Terminal on Mac OS X
set interface to "enXX" # 把它換成你的無線網卡編號
set ssid to "" # 填入你想連接網路的 SSID
set passwd to (text returned of (display dialog "Enter password:" default answer "" with hidden answer))
do shell script "networksetup -setairportnetwork " & interface & " " & (quoted form of ssid) & " " & (quoted form of passwd)
@mathiasbynens
mathiasbynens / jquery.preload.js
Created April 22, 2010 17:11
JavaScript preload() function
/*!
* $.preload() function for jQuery – http://mths.be/preload
* Preload images, CSS and JavaScript files without executing them
* Script by Stoyan Stefanov – http://www.phpied.com/preload-cssjavascript-without-execution/
* Slightly rewritten by Mathias Bynens – http://mathiasbynens.be/
* Note that since this script relies on jQuery, the preloading process will not start until jQuery has finished loading.
*/
jQuery.preload = function(array) {
var length = array.length,