This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ANIMATION_END = "webkitAnimationEnd mozAnimationEnd | |
MSAnimationEnd oanimationend | |
animationend" | |
$.fn.anim = (cls, options, nextDelay) -> | |
@removeClass("animated #{@data('_last_anim')}") | |
@data '_last_anim', cls | |
if 'number' is typeof options | |
options = { duration: "#{options/1000}s" } | |
if options? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String.prototype.blength = function() { | |
return this.replace(/\n\r/g, '\n').replace(/[^\x00-\xff]/g, 'xx').length; | |
}; | |
function btrunc(text, limit) { | |
limit = Number(limit) || 10 | |
if (text.blength() < limit * 2) { | |
return text | |
} | |
var ret = '', count = 0, i = 0, max = limit * 2 - 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TT_TEMPLATES = | |
suggestion: (d) -> | |
"<p>#{d.name} <small class=\"district\">#{d.district}</small></p>" | |
map = new AMap.Map elem, level: 4 | |
map.plugin ['AMap.Autocomplete'], => | |
bb = new Bloodhound | |
datumTokenizer: (d) -> [d.name, d.district] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!!! | |
html | |
head | |
title Responsive Test | |
<style>body { margin: 20px; font-family: sans-serif; overflow-x: scroll; }.wrapper { width: 6000px; }.frame { float: left; }h2 { margin: 0 0 5px 0; }iframe { margin: 0 20px 20px 0; border: 1px solid #666; }</style> | |
body | |
- sizes = [ [240, 320, 'mobile'], [320, 480, 'mobile'], [480, 640, 'small tablet'], [768, 1024, 'tablet - portrait'], [1024, 768, 'tablet - landscape'], [1200, 800, 'desktop'], ]; | |
.wrapper | |
each item in sizes | |
.frame |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this script should be inline | |
(function(win, doc, seajs) { | |
var $ = function(id) { | |
if (typeof id == 'string') return document.getElementById(id); | |
return id; | |
}; | |
$.uuid = 0; | |
/** | |
* @param {array} funs 需要执行的函数,一个文本数组. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var conf = central.conf; | |
var reg_val = /#{([^}]+)}/g; | |
module.exports = function(app) { | |
app.helpers({ | |
DEBUG: conf.debug | |
}); | |
app.dynamicHelpers({ | |
// inline static | |
istatic: function(req, res) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var canNative = (function() { | |
var elem = document.createElement('input'); | |
return 'placeholder' in elem; | |
})(); | |
$.fn.placeholder = function(text, cls, noNative) { | |
var self = this; | |
text = text || ''; | |
cls = cls || 'blur'; | |
if (!noNative && canNative) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* The first commented line is your dabblet’s title | |
*/ | |
background: #f06; | |
background: linear-gradient(45deg, #f06, yellow); | |
min-height: 100%; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#... 加入你的启动脚本中 | |
su www -c "/srv/nodejs/nogo.sh weixin halt reboot" | |
su www -c "/srv/nodejs/nogo.sh loudlaw halt reboot" |
OlderNewer