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
let tags = ` | |
<script src = "https://localhost:4200/runtime.js" /> | |
<script src = "https://localhost:4200/polyfills.js" /> | |
<script src = "https://localhost:4200/styles.js" /> | |
<script src = "https://localhost:4200/vendor.js" /> | |
<script src = "https://localhost:4200/main.js" /> | |
`; | |
document.body.insertAdjacentHTML( 'beforeend', tags); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Simple Charts</title> | |
</head> | |
<body> | |
</body> | |
<script type="text/javascript"> |
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
//This sends data from WebView to React Native | |
... | |
<script> | |
window.postMessage("Sending data from WebView"); | |
</script> | |
... | |
//In order to get data the was sent from WebView use onMessage prop on <WebView> | |
... |
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
//This sends data from RN to webview | |
this.webview.postMessage("Hello from RN"); | |
//to get this data into webview | |
... | |
<script> |
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
// note there may be a better way to abuse flexbox than this :) | |
var React = require('react-native') | |
var { View, TextInput } = React | |
var BorderedInput = React.createClass({ | |
getInitialState() { | |
return { i: 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
function sync(gen) { | |
var iterable, resume, check, vals, ops; | |
vals = []; | |
ops = 0; | |
check = function() { | |
if (vals.length == ops) { | |
if (ops == 1) { | |
iterable.next(vals[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
var uselessAsync = {}; | |
uselessAsync.parallel = function(tasks, callback) { | |
var completed = 0; | |
var finalData = []; | |
var cb = function(err, data, iter) { | |
completed++; |
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
//Server | |
var express = require('express'); | |
var fs = require('fs'); | |
var app = express(); | |
var server = require('http').createServer(app).listen(5000); | |
var bus = require('bus.io')(server); | |
bus.io().on('connection', function(socket) { | |
console.log(socket.id); | |
socket.emit('echo', 'HERE IS MY BUS'); |
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 Promise = function(inst) { | |
if (inst instanceof Promise) { | |
return inst; | |
} | |
else { | |
this.promises = []; | |
return 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 fs = require('fs'); | |
var path = require('path'); | |
module.exports = function(grunt) { | |
grunt.registerMultiTask('linecounter', 'counts the number of lines in files', function( ) { | |
var count = 0; | |
var done = this.async(); | |
this.files[0].src.forEach(function(a) { | |
console.log(a); | |
fs.createReadStream(a).on('data', function(chunk) { |