links for old versions of Docker for Mac
Docker provides download links in release note. They promised that
(we) will also include download links in release notes for future releases.
Note:
var d = new Date(); | |
d = new Date(d.getTime() - 3000000); | |
var date_format_str = d.getFullYear().toString()+"-"+((d.getMonth()+1).toString().length==2?(d.getMonth()+1).toString():"0"+(d.getMonth()+1).toString())+"-"+(d.getDate().toString().length==2?d.getDate().toString():"0"+d.getDate().toString())+" "+(d.getHours().toString().length==2?d.getHours().toString():"0"+d.getHours().toString())+":"+((parseInt(d.getMinutes()/5)*5).toString().length==2?(parseInt(d.getMinutes()/5)*5).toString():"0"+(parseInt(d.getMinutes()/5)*5).toString())+":00"; | |
console.log(date_format_str); | |
//2015-03-31 13:35:00 |
// Implementation in ES6 | |
function pagination(c, m) { | |
var current = c, | |
last = m, | |
delta = 2, | |
left = current - delta, | |
right = current + delta + 1, | |
range = [], | |
rangeWithDots = [], | |
l; |
Docker provides download links in release note. They promised that
(we) will also include download links in release notes for future releases.
Note:
⇐ back to the gist-blog at jrw.fi
Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.
I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.
This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso
// MIT Licensed | |
// Author: jwilson8767 | |
/** | |
* Waits for an element satisfying selector to exist, then resolves promise with the element. | |
* Useful for resolving race conditions. | |
* | |
* @param selector | |
* @returns {Promise} | |
*/ |
Beyond Compare 4 | |
Licensed to: ASIO Allsoftinone | |
Quantity: 1 user | |
Serial number: 1822-9597 | |
License type: Pro Edition for Windows | |
--- BEGIN LICENSE KEY --- | |
H1bJTd2SauPv5Garuaq0Ig43uqq5NJOEw94wxdZTpU-pFB9GmyPk677gJ | |
vC1Ro6sbAvKR4pVwtxdCfuoZDb6hJ5bVQKqlfihJfSYZt-xVrVU27+0Ja | |
hFbqTmYskatMTgPyjvv99CF2Te8ec+Ys2SPxyZAF0YwOCNOWmsyqN5y9t |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Jed Schmidt <http://jed.is> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
var blob = window.atob("AAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAgD8AAAAA"), // Base64 string converted to a char array | |
fLen = blob.length / Float32Array.BYTES_PER_ELEMENT, // How many floats can be made, but be even | |
dView = new DataView( new ArrayBuffer(Float32Array.BYTES_PER_ELEMENT) ), // ArrayBuffer/DataView to convert 4 bytes into 1 float. | |
fAry = new Float32Array(fLen), // Final Output at the correct size | |
p = 0; // Position | |
for(var j=0; j < fLen; j++){ | |
p = j * 4; | |
dView.setUint8(0,blob.charCodeAt(p)); | |
dView.setUint8(1,blob.charCodeAt(p+1)); |
正则匹配 | |
匹配中文字符的正则表达式: [\u4e00-\u9fa5] | |
评注:匹配中文还真是个头疼的事,有了这个表达式就好办了 | |
匹配双字节字符(包括汉字在内):[^\x00-\xff] | |
评注:可以用来计算字符串的长度(一个双字节字符长度计2,ASCII字符计1) | |
匹配空白行的正则表达式:\n\s*\r | |
评注:可以用来删除空白行 |