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
license: gpl-3.0 |
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
/** | |
* author Remy Sharp | |
* url http://remysharp.com/tag/marquee | |
*/ | |
(function ($) { | |
$.fn.marquee = function (klass) { | |
var newMarquee = [], | |
last = this.length; |
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 convertTimestamp(timestamp) { | |
var d = new Date(timestamp * 1000), // Convert the passed timestamp to milliseconds | |
yyyy = d.getFullYear(), | |
mm = ('0' + (d.getMonth() + 1)).slice(-2), // Months are zero based. Add leading 0. | |
dd = ('0' + d.getDate()).slice(-2), // Add leading 0. | |
hh = d.getHours(), | |
h = hh, | |
min = ('0' + d.getMinutes()).slice(-2), // Add leading 0. | |
ampm = 'AM', | |
time; |
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
#!/bin/sh | |
echo Install all AppStore Apps at first! | |
# no solution to automate AppStore installs | |
read -p "Press any key to continue... " -n1 -s | |
echo '\n' | |
echo Install and Set San Francisco as System Font | |
ruby -e "$(curl -fsSL https://raw.github.com/wellsriley/YosemiteSanFranciscoFont/master/install)" | |
echo Install Homebrew, Postgres, wget and cask | |
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" |
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
来源:http://www.cnblogs.com/devinhua/articles/1726292.html | |
1、简单的正则表达式: | |
(1)preg_match("/^(\d{18,18}|\d{15,15}|\d{17,17}x)$/",$id_card) | |
(2)preg_match("/^(\d{6})(18|19|20)?(\d{2})([01]\d)([0123]\d)(\d{3}) (\d|X)?$/",$id_card) | |
(3)preg_match("/(^\d{15}$/)|(\d{17}(?:\d|x|X)$/),$id_card) |
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
// Bonfire: Meet Bonfire | |
// Author: @2lei | |
// Challenge: http://www.freecodecamp.com/challenges/bonfire-meet-bonfire# | |
// Learn to Code at Free Code Camp (www.freecodecamp.com) | |
function meetBonfire(argument) { | |
// Good luck! | |
console.log("you can read this function's argument in the developer tools", argument); | |
return true; |
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
/** | |
* @author xiaojue | |
* @date 20160420 | |
* @fileoverview 倒计时 | |
*/ | |
(function() { | |
function timer(delay) { | |
this._queue = []; | |
this.stop = false; |
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
/** | |
* 遍历文件夹目录 | |
* @param {[type]} dir [description] | |
* @param {Function} callback [description] | |
* @return {[type]} [description] | |
*/ | |
function travel(dir, callback) { | |
var fileList = [], | |
folderList = []; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Test 2 way data binding</title> | |
</head> | |
<body> | |
<div id="app">{{ abc }} - {{ def }} = {{ abc-def }} </div> | |
<button id='add'>add</button> | |
<button id='double'>double</button> | |
<script src='main.js'></script> |
OlderNewer