鱼的记忆只有七秒,(七秒),关于你的记忆只有雨中的九秒,被淋湿,视线模糊了,是雨水
This file contains hidden or 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 observeStore(store, select, onChange) { | |
| let currentState; | |
| function handleChange() { | |
| let nextState = select(store.getState()); | |
| if (nextState !== currentState) { | |
| currentState = nextState; | |
| onChange(currentState); | |
| } | |
| } |
This file contains hidden or 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> | |
| <body> | |
| <div id="rte" contenteditable="true" style="height: 100%; width: 100%; outline: 0; overflow: auto"></div> | |
| <script type="text/javascript"> | |
| document.getElementById("rte").focus(); | |
| document.body.addEventListener("paste", function(e) { | |
| for (var i = 0; i < e.clipboardData.items.length; i++) { | |
| if (e.clipboardData.items[i].kind == "file" && e.clipboardData.items[i].type == "image/png") { | |
| // get the blob | |
| var imageFile = e.clipboardData.items[i].getAsFile(); |
This file contains hidden or 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 img=new Image(); | |
| img.src="mm.jpg"; | |
| img.onload=function(){ | |
| var image = document.createElement('img'); | |
| image.src = img; | |
| document.body.appendChild(image); | |
| }; |
This file contains hidden or 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 uploadAudio(mp3Data){ | |
| var reader = new FileReader(); | |
| reader.onload = function(event){ | |
| var fd = new FormData(); | |
| var mp3Name = encodeURIComponent('audio_recording_' + new Date().getTime() + '.mp3'); | |
| console.log("mp3name = " + mp3Name); | |
| fd.append('fname', mp3Name); | |
| fd.append('data', event.target.result); | |
| $.ajax({ | |
| type: 'POST', |
This file contains hidden or 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 on(elSelector, eventName, selector, handler, useCapture) { | |
| const _useCapture = useCapture === undefined ? false : useCapture; | |
| const elements = document.querySelectorAll(elSelector); | |
| const addEventListener = function(element) { | |
| element.addEventListener(eventName, function(e) { | |
| for (let target = e.target; target && target != this; target = target.parentNode) { | |
| // loop parent nodes from the target to the delegation node | |
| let match = false; | |
| if (target.matches) { | |
| match = target.matches(selector); |
This file contains hidden or 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 nodeContainsWorksWithTextNodes = false; | |
| try { | |
| var testParent = document.createElement('div'), | |
| testText = document.createTextNode(' '); | |
| testParent.appendChild(testText); | |
| nodeContainsWorksWithTextNodes = testParent.contains(testText); | |
| } catch (exc) {} | |
| function isDescendant(parent, child, checkEquality) { | |
| if (!parent || !child) { |
This file contains hidden or 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
| git gc --prune=now | |
| git remote prune origin |
This file contains hidden or 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
| open -a Google\ Chrome\ Canary --args --disable-web-security |
This file contains hidden or 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
| .visually-hidden { | |
| clip: rect(1px, 1px, 1px, 1px); | |
| position: absolute !important; | |
| overflow: hidden; | |
| height: 1px; | |
| width: 1px; | |
| } |
OlderNewer