Skip to content

Instantly share code, notes, and snippets.

@imEhllBdPGMVaArZ
imEhllBdPGMVaArZ / base.js
Created May 23, 2015 06:58
做地用页面的时候需要用到的通用js,慢慢积累- -
// 横竖屏
(function() {
orientationHandle();
}());
function orientationHandle() {
if(window.orientation === 0) { // 竖屏
} else { // 横屏
}
};
@imEhllBdPGMVaArZ
imEhllBdPGMVaArZ / placeholder.html
Created March 30, 2015 09:42
placeholder的积累,看下情况
<script>
// Placeholder
$('input[aria-label]').each(function() {
var current = $(this);
var flag = !!current.attr('aria-label');
if(flag) {
$('<span class="placeholder">'+current.attr('aria-label')+'</span>').appendTo(current.parent())
};
current.on("focus", function() {
@imEhllBdPGMVaArZ
imEhllBdPGMVaArZ / meta.html
Last active August 29, 2015 14:14
常用meta标签记录
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" cotent="IE=edge, chrome=1"><!-- 浏览器以最新版本显示页面 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><!-- 默认的文档编码 -->
<meta name="viewport" content="user-scalable=no,width=device-width"><!-- 手机viewpoert设置 -->
<meta name="renderer" content="webkit"><!-- 告诉360浏览器切换为webkit核心(其他的国产多核浏览器会添加这个支持吧?谁知呢!) -->
<title>常用Meta标签</title>
</head>
</html>
@imEhllBdPGMVaArZ
imEhllBdPGMVaArZ / 基本模板.sass
Last active August 29, 2015 14:14
新建sass文件的时候的初始内容
/*!
* @author : ${1:author}
* @date : ${2:date}
* @desc : ${3:description}
* @notice : generated by SCSS
**/
$base_font_size: 10px!default;
@function rem($size) {
@return $size / $base_font_size * 1rem;
@imEhllBdPGMVaArZ
imEhllBdPGMVaArZ / haskell-01.php
Created October 8, 2014 14:05
九九乘法表
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>9x9</title>
<style>
span { padding: 0 10px; }
</style>
</head>
<body>
@imEhllBdPGMVaArZ
imEhllBdPGMVaArZ / naming-css-stuff-is-really-hard-zh.md
Created September 26, 2014 10:01
CSS命名真是件难事(译文)

#CSS命名真是件难事 原文:[Naming CSS Stuff Is Really Hard][1]

这不是一篇关于CSS结构的文章,当然也不是关于命名的相关规范。相反,让我们来谈谈我们怎么调用元素。他们自己的名称。The things we use to link blocks of styles to the elements they're associated with(我们使用连接块的东西他们与风格的元素)。

10个人里面有9个人会同意:在写CSS的时候,给需要的元素命名是最纠结的部分(译者:原文difficult, 认为命名其实可以很随意,但是想命好却很难、很纠结)。这是因为我们并不能预知未来(未来的需求变更)。一个CSS类名在某天或许很适合,但当设计更改,在某天这个就是错误的了。然后我们又要去重改我们的代码结构、样式来满足当前的需求。是不是感觉很讨厌呢?

我们该如何去解决这种问题?以使所选的名字尽可能的保持稳定。

@imEhllBdPGMVaArZ
imEhllBdPGMVaArZ / README.md
Last active August 29, 2015 14:06
公司网站常用tab结构以及样式

###演示

http://jsfiddle.net/lyplba/6ezx2zoz/

###注意

1、在用于生产环境时,请确保进行了浏览器默认样式的清理工作(比如常用的reset.css)

2、这里的标签切换只是提供基本的表现(未带相应交互效果),根据需要可以通过外挂其他样式名来更改

@imEhllBdPGMVaArZ
imEhllBdPGMVaArZ / publication-item.html
Last active August 29, 2015 14:05
问答社区列表条目的结构
<div class="pub_item">
<div class="pub_item_wrap clearfix">
<div class="pub_summary">
<div class="pub_title"><a href="#">标题名称</a></div>
<div class="pub_meta clearfix">
<small class="meta_item timestamp">2014-5-14 18:20</small>
<small class="meta_item">217浏览</small>
<p class="meta_cont">The quick, brown fox jumps over a lazy dog.</p>
</div>
<div class="pub_action">
@imEhllBdPGMVaArZ
imEhllBdPGMVaArZ / closure.html
Created August 2, 2014 02:24
简单的闭包示例
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>闭包示例</title>
<script>
/*
自己的惯性思维写的
比较糟糕的一种方式,在循环中创建了函数,带来无谓的计算,引起混淆,
@imEhllBdPGMVaArZ
imEhllBdPGMVaArZ / SassMeister-input-HTML.html
Created April 17, 2014 09:23
Generated by SassMeister.com.
<a href="#">Anchor</a>