Skip to content

Instantly share code, notes, and snippets.

lorrylockie lorrylockie

Block or report user

Report or block lorrylockie

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@lorrylockie
lorrylockie / javascript_resources.md
Created Jun 17, 2014 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.
View javascript_resources.md

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
View gist:7743771
http://maq128.github.io/tae-js-testbed/?html=%3Cinput%20type%3D%22text%22%20class%3D%22my-calendar%22%20%2F%3E%0A%3Ccajamodules%20inlucde%3D%22kissy%2F1.3.0%2Fcore%2Cgs%2F1.0%2Findex%22%20%2F%3E%0A%0A%20%20%20%20%3Cp%3Edfdfdf%3C%2Fp%3E%0A%20%20%20%20%3Cp%3Edfdfdf%3C%2Fp%3E%0A%20%20%20%20%3Cp%3Edfdfdf%3C%2Fp%3E%0A%20%20%20%20%3Cp%3Edfdfdf%3C%2Fp%3E%0A%20%20%20%20%3Cp%3Edfdfdf%3C%2Fp%3E%0A%20%20%20%20%3Cp%3Edfdfdf%3C%2Fp%3E%0A%20%20%20%20%3Cp%3Edfdfdf%3C%2Fp%3E%0A%20%20%20%20%3Cp%3Edfdfdf%3C%2Fp%3E%0A%20%20%20%20%3Cp%3Edfdfdf%3C%2Fp%3E%0A%20%20%20%20%3Cp%3Edfdfdf%3C%2Fp%3E%0A%20%20%20%20%3Cp%3Edfdfdf%3C%2Fp%3E%0A%20%20%20%20%3Cp%3Edfdfdf%3C%2Fp%3E%0A%20%20%20%20%3Cp%3Edfdfdf%3C%2Fp%3E%0A%20%20%20%20%3Cp%3Edfdfdf%3C%2Fp%3E%0A%20%20%20%20%3Cp%3Edfdfdf%3C%2Fp%3E%0A%20%20%20%20%3Cp%3Edfdfdf%3C%2Fp%3E%0A%20%20%20%20%3Cp%3Edfdfdf%3C%2Fp%3E%0A%20%20%20%20%3Cp%3Edfdfdf%3C%2Fp%3E%0A%20%20%20%20%3Cp%3Edfdfdf%3C%2Fp%3E%0A%20%20%20%20%3Cp%3Edfdfdf%3C%2Fp%3E%0A%20%20%20%20%3Cp%3Edfdfdf%3C%2Fp%3E%0A%20%20%20%20%3Cp%3Edfdfdf%
@lorrylockie
lorrylockie / favicon
Created Mar 12, 2013
精准的 favicon
View favicon
<link rel="apple-touch-icon" href="path/to/touchicon.png">
<link rel="icon" href="path/to/favicon.png">
<!--[if IE]><link rel="shortcut icon" href="path/to/favicon.ico"><![endif]-->
<!-- or, set /favicon.ico for IE10 win -->
<meta name="msapplication-TileColor" content="#D83434">
<meta name="msapplication-TileImage" content="path/to/tileicon.png">
@lorrylockie
lorrylockie / grunt.js
Created Nov 25, 2012
grunt-init-file
View grunt.js
/*global module:false*/
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
meta: {
version: '0.1.0',
banner: '/*! PROJECT_NAME - v<%= meta.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'* http://PROJECT_WEBSITE/\n' +
@lorrylockie
lorrylockie / gist:3215037
Created Jul 31, 2012
正则判断长度 一个汉字代表两个字符。
View gist:3215037
replace([^\x00-\xff]/g,"aa").length
@lorrylockie
lorrylockie / gist:2927761
Created Jun 14, 2012
数组去重o(n)复杂度
View gist:2927761
/*这个无法处理对象 {"a":1},{"a":1} */
Array.prototype.strip = function(){
var a =0, b ={};
for(a=0;a<this.length;a++){
if(b[typeof(this[a])+this[a]]===this[a]){
this.splice(a--,1);
}else{
b[typeof(this[a])+this[a]]=this[a];
}
@lorrylockie
lorrylockie / css-parse
Created Mar 14, 2012
css parse for javascript
View css-parse
KISSY.add(function(S) {
//switch css parse code to kissy module
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
@lorrylockie
lorrylockie / html-analysis
Created Mar 14, 2012
html parse for javascript
View html-analysis
/**
* @fileOverview 校验html是否闭合
* @link http://fed.ued.taobao.net/shop-team/products/platinum/docs/specification/build/html/
* @creator 石霸<shiba@taobao.com>
* @date 2012. 03.03
* @version 1.0
* @update
*/
KISSY.add(function (S, Analyzer) {
var Common = new (function () {
@lorrylockie
lorrylockie / html
Created Mar 6, 2012 — forked from anonymous/html
array中增加remove方法
View html
//给Array增加remove方法
Array.prototype.remove = function (str) {
for (var index = this.length - 1; index >= 0; index--) {
if (str == this[index].tagName) {
this.splice(index, 1);
return true;
}
}
return false;
};
View getShortUrl
$.getJSON("http://api.bit.ly/v3/shorten?login=ruanyf&apiKey=R_7685e120ea72c1b49b55a681d09e35d0&format=json&longUrl=" + encodeURIComponent("#http://www.taobao.com#") + "&callback=?", function (data) {
console.log(data);
}
);
You can’t perform that action at this time.