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
'use strict'; | |
const arrayProto = Array.prototype; | |
const arrayMethods = Object.create(arrayProto); | |
const newArrProto = []; | |
['push','pop','shift','unshift','splice','sort','reverse'].forEach(function (method) { | |
let original = arrayMethods[method]; | |
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 worker = new Worker("worker.js"); | |
worker.postMessage( | |
{ | |
id:1, | |
msg:'Hello World' | |
} | |
); | |
worker.onmessage=function(message){ | |
var data = message.data; | |
document.write(data.msg); |
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 CommentBox = React.createClass({ | |
getInitalState: function() { | |
return {data: []}; | |
}, | |
componentDidMount: function() { | |
$.ajax({ | |
url: this.props.url, | |
dataType: 'json', | |
success: funciton(data) { | |
this.setState({data: data}); |
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>React-App</title> | |
<script src="https://unpkg.com/react@15.3.2/dist/react.js"></script> | |
<script src="https://unpkg.com/react-dom@15.3.2/dist/react-dom.js"></script> | |
<style media="screen" type="text/css"> | |
.todocontent, .inprogresscontent { | |
float: left; | |
position: relative; |
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> | |
<body> | |
<h1>Thoughts</h1> | |
<form> | |
<input><button>Add</button> | |
</form> | |
<ul></ul> | |
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script> |
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>ToDo</title> | |
<script src="https://cdn.rawgit.com/amark/gun/master/gun.js"></script> | |
<script src="https://unpkg.com/react@15.3.2/dist/react.js"></script> | |
<script src="https://unpkg.com/react-dom@15.3.2/dist/react-dom.js"></script> | |
<style media="screen" type="text/css"> | |
.todocontent, .inprogresscontent { | |
float: left; |
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
curl -XPUT 'http://localhost:9200/us/user/1?pretty=1' -d ' | |
{ | |
"email" : "john@smith.com", | |
"name" : "John Smith", | |
"username" : "@john" | |
} | |
' | |
curl -XPUT 'http://localhost:9200/gb/user/2?pretty=1' -d ' | |
{ |
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import sys,os,re,urllib | |
folder="e:\image\\" | |
reg=re.compile("((?<=imgurl=)http.*?\.(jpg|gif|png|bmp|jpeg))")#正则表达式匹配下载地址 | |
reg2=re.compile("((?<=/)[^/]*?\.(jpg|gif|png|bmp|jpeg))") | |
fd=open('image.htm','r') | |
html=fd.read() | |
fd.close() |
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import sys,os,re,urllib | |
folder="e:\image\\" | |
reg=re.compile("((?<=\"objURL\"\:\")http.*?\.(jpg|gif|png|bmp|jpeg))")#正则表达式匹配下载地址 | |
reg2=re.compile("((?<=/)[^/]*?\.(jpg|gif|png|bmp|jpeg))") | |
fd=open('image3.htm','r') | |
html=fd.read() | |
fd.close() |
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
(custom-set-variables | |
;; custom-set-variables was added by Custom. | |
;; If you edit it by hand, you could mess it up, so be careful. | |
;; Your init file should contain only one such instance. | |
;; If there is more than one, they won't work right. | |
'(show-paren-mode t) | |
'(text-mode-hook (quote (text-mode-hook-identify)))) | |
(custom-set-faces | |
;; custom-set-faces was added by Custom. | |
;; If you edit it by hand, you could mess it up, so be careful. |