Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| var p1=new Promise(resolve => { | |
| console.log(1) | |
| resolve(2) | |
| }) | |
| var p2=new Promise(resolve => { | |
| console.log(3) | |
| resolve(p1) | |
| }) | |
| p1.then(re => { | |
| console.log(re) |
| // XMLHttpRequest | |
| var xhr = new XMLHttpRequest(); | |
| xhr.open('POST', url, true); | |
| xhr.responseType = 'arraybuffer'; | |
| xhr.onload = function () { | |
| if (this.status === 200) { | |
| var filename = ""; | |
| var disposition = xhr.getResponseHeader('Content-Disposition'); | |
| if (disposition && disposition.indexOf('attachment') !== -1) { | |
| var filenameRegex = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/; |
| class Sortable extends React.Component { | |
| componentDidMount() { | |
| // Every React component has a function that exposes the | |
| // underlying DOM node that it is wrapping. We can use that | |
| // DOM node, pass it to jQuery and initialize the plugin. | |
| // You'll find that many jQuery plugins follow this same pattern | |
| // and you'll be able to pass the component DOM node to jQuery | |
| // and call the plugin function. |
| var RegCheck = { | |
| /** | |
| * 正規表示式 | |
| */ | |
| _reg:{ | |
| // Email正規表示式 | |
| email: /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/, | |
| // 非「英文大小寫」和「數字」出現過一次 | |
| not_en_digital_least1: /[^a-zA-Z0-9]+/, | |
| // 「英文大小寫」和「數字」各出現過一次(a1,b2...) |
| <script type="text/javascript"> | |
| var your_url = 'http://www.example.com'; | |
| </script> | |
| <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js" ></script> | |
| <script type="text/javascript"> | |
| jQuery.ajax = (function(_ajax){ |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| .admin-mode-slider | |
| height: 24px | |
| margin-left: 10px | |
| background-color: #555 | |
| @include border-radius(6px) | |
| position: relative | |
| @include box-shadow(0 0 6px 0 hsla(0, 0%, 0%, 0.25)) | |
| .overlay | |
| position: absolute |
| // as of 1.4.2 the mobile safari reports wrong values on offset() | |
| // http://dev.jquery.com/ticket/6446 | |
| // remove once it's fixed | |
| if ( /webkit.*mobile/i.test(navigator.userAgent)) { | |
| (function($) { | |
| $.fn.offsetOld = $.fn.offset; | |
| $.fn.offset = function() { | |
| var result = this.offsetOld(); | |
| result.top -= window.scrollY; | |
| result.left -= window.scrollX; |
| //http://lijing00333.wordpress.com/2011/02/08/%E6%95%B0%E7%BB%84%E5%8E%BB%E9%87%8D%E2%80%94%E2%80%94%E4%B8%80%E9%81%93%E5%89%8D%E7%AB%AF%E6%A0%A1%E6%8B%9B%E8%AF%95%E9%A2%98/ | |
| // [1,2,2,2,3,4,5].toString().match(/(\d)(?!.*,\1)/g); | |
| Array.prototype.distinct = function() { | |
| var o = {}, i = 0, l = this.length; | |
| for (; i < l;) { | |
| if (!o.hasOwnProperty(this[i])) { | |
| o[this[i++]] = 1; | |
| } else { | |
| this.splice(i, 1); |
Install Homebrew
http://mxcl.github.com/homebrew/
/usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"
brew help
cd ~
mate .bashrc