Skip to content

Instantly share code, notes, and snippets.

@hulufei
hulufei / spine.ajax.update.howto.coffee
Created June 28, 2012 10:59
Spine Ajax update model handle
class User extends Spine.Model
@configure 'User', 'name'
@extend Spine.Model.Ajax
@url: '/save'
user = new User(name: 'test')
# 设定/save直接返回 {flag: 0}
user.save()
User.bind 'update', (item) ->
@hulufei
hulufei / mask.css
Created August 10, 2012 13:11
Pure css for full window mask
.modal-mask {
position: fixed;
left: 0;
top: 0;
bottom: 0;
right: 0;
background-color: #000;
opacity: 0.8;
}
@hulufei
hulufei / fix-relative.css
Created December 5, 2012 09:30
Make fixed element relative some elements other than document
.page {
width: 40em;
}
.tip {
position: fixed;
left: 50%;
bottom: 0;
margin-left: 20em; /* $pageWidth / 2*/
}
# Configs
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
config secondsBetweenRepeat 0.1
config checkDefaultsOnLoad true
config focusCheckWidthMax 3000
config keyboardLayout qwerty
config windowHintsShowIcons true
config windowHintsIgnoreHiddenWindows false
@hulufei
hulufei / custom-radio.scss
Last active December 15, 2015 22:39
Custom Radio button background image
/**
* fall back in IE < 9
* Set background alone if using Compass's css sprites, or IE8 will fail
* all background-image styles, for it doesn't support :checked
*/
input[type="radio"] {
display: none;
}
input[type="radio"] + label {
padding-left: 15px;
@hulufei
hulufei / css-triangle.styl
Last active December 15, 2015 22:49
CSS triangle with specific filled color
/**
* From twitter bootstrap
*/
popoverArrowOuterWidth = 10px
popoverArrowWidth = 9px
popoverArrowOuterColor = #CCC
popoverArrowColor = #FFF
.popover
position: absolute
@hulufei
hulufei / slide.html
Last active December 15, 2015 23:50
slide demo
<!--
better name: wrapper -> roll
-->
<div class="slides">
<div class="wrapper">
<div class="slide">
<img src="images/order-1.jpg" alt="" class="thumb" />
</div>
<div class="slide">
<img src="images/order-2.jpg" alt="" class="thumb" />

Demo

表格 - Table

收货人
订单类型 订单号
@hulufei
hulufei / helper.css
Created June 6, 2013 10:35
helper css collection
/**
* @see http://goo.gl/meG1Z
*/
.hide-text {
text-indent: 100%;
white-space: nowrap;
overflow: hidden;
}
/**
@hulufei
hulufei / tips.js
Created June 26, 2013 09:07
General tips for javascript
// prevent repeat animation
$('#demo').stop().animate({...});