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
| process.on('message', function(msg, tcp) { | |
| console.log('CHILD got message:', msg, tcp); | |
| }); | |
| process.send({ foo: 'bar' }); |
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
| #include <sys/types.h> | |
| #include <sys/socket.h> | |
| #include <stdio.h> | |
| #include <netinet/in.h> | |
| #include <arpa/inet.h> | |
| #include <unistd.h> | |
| #include <string.h> | |
| #include <stdlib.h> | |
| #include <fcntl.h> | |
| #include <sys/shm.h> |
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
| import React from 'react'; | |
| import { Editor, EditorState } from 'draft-js'; | |
| export default class EditorCore extends React.Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = { editorState: EditorState.createEmpty() }; | |
| this.onChange = this._onChange.bind(this); | |
| } | |
| _onChange(editorState) { |
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
| import React, { Component } from 'react'; | |
| import logo from '../logo.svg'; | |
| import './App.css'; | |
| import EditorCore from './EditorCore'; | |
| class App extends Component { | |
| render() { | |
| return ( | |
| <div className="App"> | |
| <div className="App-header"> |
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
| export default { | |
| BOLD: { | |
| fontWeight: 700, | |
| }, | |
| ITALIC: { | |
| fontStyle: 'italic', | |
| }, | |
| }; |
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
| import React from 'react'; | |
| import { Editor, EditorState } from 'draft-js'; | |
| import InlineStyles from '../InlineStyles'; | |
| export default class EditorCore extends React.Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = { editorState: EditorState.createEmpty() }; | |
| this.onChange = this._onChange.bind(this); | |
| } |
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 fileInput = document.querySelector('file'); | |
| var targetWidth = 400; | |
| var targetHeight = 400; | |
| function doUpload () { | |
| // upload picture | |
| } | |
| fileInput.onChange = function () { | |
| var file = this.files[0]; |
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
| [].slice.call(document.querySelectorAll('.follow_item')) | |
| .map(function(item) { | |
| var d = item.getAttribute('action-data'); | |
| var data = /uid=(\d+)&/g.exec(d); | |
| var uid = data && data[1]; | |
| if (uid) { | |
| var xhr = new XMLHttpRequest(); | |
| xhr.open('POST', 'http://weibo.com/aj/f/addblack?ajwvr=6'); | |
| xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); |
OlderNewer