Skip to content

Instantly share code, notes, and snippets.

@athiththan11
athiththan11 / pre-commit
Last active December 5, 2023 21:11
Git Pre Commit Hook for FIXME TODO
#!/bin/sh
# An hook script to verify changes to be committed do not contain
# any 'FIXME:' comments. Called by "git commit" with no arguments.
#
# The hook should exit with non-zero status after issuing an appropriate
# message if it stops the commit.
#
# To bypass this hook, use the "--no-verify" parameter when committing.
@marcopompili
marcopompili / TrackballControls.js
Last active February 23, 2024 08:31
GeoJSON Test
/**
* @author Eberhard Graether / http://egraether.com/
*/
THREE.TrackballControls = function ( object, domElement ) {
var _this = this;
var STATE = { NONE: -1, ROTATE: 0, ZOOM: 1, PAN: 2, TOUCH_ROTATE: 3, TOUCH_ZOOM: 4, TOUCH_PAN: 5 };
this.object = object;
@shawndxl
shawndxl / less loop.md
Last active November 19, 2018 13:36
用 LESS 写一个帧动画类型的函数 / LESS keyframes loop method

用 LESS 写一个 可复用的 帧动画类型的 函数 / A css keyframes loop with LESS

For example , you have a css animation like this

/* CSS */
@keyframes demo {
	0% { background-image: url(../img/demo/1.png); }
	20% { background-image: url(../img/demo/2.png); }
	40% { background-image: url(../img/demo/3.png); }
	60% { background-image: url(../img/demo/4.png); }
@GiaoGiaoCat
GiaoGiaoCat / wechat-useragent.js
Created March 6, 2015 03:59
微信内置浏览器UserAgent的判断
// 检测浏览器的 User Agent 应该是非常简单的事情
// 微信在 Android 下的 User Agent
mozilla/5.0 (linux; u; android 4.1.2; zh-cn; mi-one plus build/jzo54k) applewebkit/534.30 (khtml, like gecko) version/4.0 mobile safari/534.30 micromessenger/5.0.1.352
// 微信在 iPhone 下的 User Agent
mozilla/5.0 (iphone; cpu iphone os 5_1_1 like mac os x) applewebkit/534.46 (khtml, like gecko) mobile/9b206 micromessenger/5.0
// 通过javascript判断
// 很容易看出来,微信的 User Agent 都有‘micromessenger’字符串标示,我们判断是否含有这些字符串就OK了
function isWeixinBrowser(){