Skip to content

Instantly share code, notes, and snippets.

View mcattx's full-sized avatar
🎯
learning

mcattx mcattx

🎯
learning
View GitHub Profile
@mcattx
mcattx / reset.css
Last active February 24, 2018 06:23
a reset css for web page #css
/*参考了normalize.css和aliceui.org*/
/* ==========================================================================
Base
========================================================================== */
/**
* 1. 修正文本(text)当body标签的`font-size`使用`em`为单位时的缩放错误
* 2. 预防iOS在切换方向之后文本字号适应错误
*/
@mcattx
mcattx / fn.css
Last active February 24, 2018 06:23
Common function css, such as Clear float. #css
/* 清除浮动 */
.fn-clear:after {
content: ".";
display: block;
height: 0;
visibility: hidden;
clear: both;
}
.fn-clear {
*zoom: 1;
@mcattx
mcattx / 0_reuse_code.js
Last active August 29, 2015 14:19
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mcattx
mcattx / javascript_resources.md
Last active August 29, 2015 14:19 — 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
@mcattx
mcattx / css_resources.md
Last active August 29, 2015 14:19 — 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

@mcattx
mcattx / gulpfile.js
Last active August 29, 2015 14:20
gulp-md5-test
var gulp = require('gulp'),
md5Plus = require('gulp-md5-plus'),
md5Assets = require('gulp-md5-assets');
/* gulp-md5-plus demo */
/**
* 测试结果如下,可以修改 css 的名字和 css 引用的图片名字,
* 也可以修改 html 对 css 的引用。
* task md5Plus 是修改 html 对静态资源的引用,
* task img 是修改 css 和 css 引用图片的名字。
@mcattx
mcattx / swift-basic.md
Created October 15, 2015 03:47 — forked from teabyii/swift-basic.md
Swift 入门笔记

swift 入门笔记

变量

let 声明常量,var 声明变量

var myVariable = 2
myVariable = 3
let myConstant = 4
@mcattx
mcattx / fullScreen.js
Created November 17, 2015 08:06
全屏API
/**
* 判断是否支持全屏
*
* @return {Boolean} boolean 返回布尔值
*/
function canFullscreen() {
var el = document.body;
return (
typeof (
el.requestFullScreen ||
@mcattx
mcattx / amap.html
Created November 26, 2015 10:16
高德地图 API 应用实例代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<title>高德地图测试</title>
<style type="text/css">
body, html,#allmap {width: 100%;height: 100%;overflow: hidden;margin:0;font-family:"微软雅黑";}
#container {