Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| ;(function(libName, libBody) { | |
| var hasDefine = typeof define === 'function'; | |
| hasExports = typeof module !== "undefined" && module.exports; | |
| if(hasDefine) { | |
| if(define.AMD) { | |
| // AMD environment | |
| define(libBody); | |
| $(function () { | |
| $('#navigation a').stop().animate({ | |
| 'marginLeft': '-85px' | |
| }, 1000); | |
| $('#navigation > li').hover( | |
| function () { | |
| $('a', $(this)).stop().animate({ | |
| 'marginLeft': '-2px' |
| // 观察者模式 | |
| var observer = { | |
| addSubscriber: function (callback) { | |
| this.subscribers[this.subscribers.length] = callback; | |
| }, | |
| removeSubscriber: function (callback) { | |
| var len = this.subscribers.length, | |
| i; |
| // define | |
| var sleep = function(seconds) { | |
| var start = (new Date)['getTime'](), | |
| i = 1e8; | |
| while (i--) { | |
| if ((new Date)['getTime']() - start >= seconds * 1e3) { // must be gte! | |
| return false; | |
| } | |
| } |
| ;(function($) { | |
| // multiple plugins can go here | |
| (function(pluginName) { | |
| var defaults = { | |
| color: 'black', | |
| testFor: function(div) { | |
| return true; | |
| } | |
| }; | |
| $.fn[pluginName] = function(options) { |
| /** | |
| * sortable table plugin for jQuery | |
| * @autor - gaofeng <gfeng.peak@gmail.com> | |
| * @desc - make table sortable | |
| * @version 0.1 | |
| */ | |
| (function() { | |
| /** | |
| * Determine whether the string contains Chinese |
//
// oo0oo
// o8888888o
// 88" . "88
// (| -_- |)
// 0\ = /0
// _/`---'_
// .' \| |// '.
// / \||| : |||//
// / _||||| -:- |||||- \
| // ---- | |
| // libsass (v3.2.5) | |
| // ---- | |
| @mixin rgba($property, $background, $opacity, $mix: white) { | |
| #{$property}: mix($background, $mix, $opacity * 100%); | |
| #{$property}: rgba($background, $opacity); | |
| @if 1 == 1 { | |
| const fs = require('fs'); | |
| // lib to read and write to the zip | |
| const JSZip = require('jszip'); | |
| fs.readFile('Untitled3.sketch', function(err, data) { | |
| if(err) throw err; | |
| JSZip.loadAsync(data).then(function(zip) { | |
| // zip contains a json file that describes all the directory & files in the zip file |