Skip to content

Instantly share code, notes, and snippets.

View movii's full-sized avatar

movii movii

  • Shanghai, China
  • 19:23 (UTC +08:00)
View GitHub Profile
@movii
movii / css_resources.md
Created December 5, 2013 04:03 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@movii
movii / javascript_resources.md
Created December 5, 2013 04:03 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

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
@movii
movii / getNumberKeyboard.html
Last active August 29, 2015 14:02
on safari of iOS , this line of attributes in the html input element will get number keyboard out; in this case, it will also force the max-length for the input length to be four character long.
<input type="text" value="" id="getNumberKeyboard" maxlength="4" pattern="[0-9]*">
@movii
movii / StringBasic.swift
Last active August 29, 2015 14:06
Swift 1. Core Syntax
var str = "Hello, playground";
var highScore:Int = 1000;
highScore = highScore + 100;
for i in 0..<100 {
highScore = highScore + i;
}
var firstName:String = "Chip";
@movii
movii / OSXConfigureGitAutoCompletion.md
Last active August 29, 2015 14:10
OSX configure git auto completeion

###OSX configure git auto completeion

open terminal

cd ~ 

hit return(make sure you are in the home dir) then paste in

curl -OL https://github.com/git/git/raw/master/contrib/completion/git-completion.bash
{
"cmd": ["/usr/local/bin/python3", "$file"],
"selector": "source.python",
"file_regex": "file \"(...*?)\", line ([0-9]+)",
"env": {"LANG": "en_US.UTF-8"}
}
//In Sublime Text 3, Tools -> Build System -> New Build System
//replace the "cmd" path with your 'which python3' result in terminal
@movii
movii / 为《JavaScript 设计模式与开发实践》第八章最后的例子添加注释.js
Last active December 17, 2018 09:25
第八章「发布—订阅模式」最后章节中的例子,包含离线消息接受和 namespace 实现的全局 Event 对象,原文中大段大段的代码没有注释(我看的是 kindle 的电子版,不知纸质的咋样),所以给加了一遍注释,还删掉些完全没有用到过但声明了的变量。
var Event = (function() {
var Event;
var _default = 'default';
Event = function() {
var _listen;
var _trigger;
var _remove;
var _shift = Array.prototype.shift;
let offset = 0
, len = view.byteLength;
// SOI marker
if (view.getUint16(0, false) != 0xFFD8) reject('不是 JPEG 文件');
// APP1 marker
while (offset < len) {
if (view.getUint16(offset, false) == 0xFFE1) break;
else offset += 2;
switch (EXIF.orientation) {
case 2: ctx.transform(-1, 0, 0, 1, width, 0); break;
case 3: ctx.transform(-1, 0, 0, -1, width, height ); break;
case 4: ctx.transform(1, 0, 0, -1, 0, height ); break;
case 5: ctx.transform(0, 1, 1, 0, 0, 0); break;
case 6: ctx.transform(0, 1, -1, 0, height , 0); break;
case 7: ctx.transform(0, -1, -1, 0, height , width); break;
case 8: ctx.transform(0, -1, 1, 0, 0, width); break;
default: ctx.transform(1, 0, 0, 1, 0, 0);
}
@movii
movii / index.html
Last active June 23, 2017 15:32
使用 CSS 伪类为 select 元素添加 placeholder: 2. onchange event with javascript
<select onchange="this.className=this.options[this.selectedIndex].className" class="placeholder">
<option value="" selected class="placeholder">placeholder</option>
<option value="1" class="green">green</option>
<option value="2" class="red">red</option>
</select>