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
<head> | |
<title>My App</title> | |
</head> | |
<body> | |
<div class="app"></div> <!-- We use class here because we're not in the react environment, so don't mix things up --> | |
</body> |
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
// Grab the react and react-dom pkg | |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
// Write an App Component | |
const App = () => { | |
return ( | |
<div> Hello World! </div> | |
); | |
}; |
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
// Grab the react and react-dom pkgs --> | |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
// Grab Router, Route and browserHistory from react-router -> | |
import { Router, Route, IndexRoute, browserHistory } from 'react-router'; | |
// Grab Navigation component --> | |
import Navigation from '../components/navigation'; |
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
// Grab the react and react-dom pkgs --> | |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
// Grab Router, Route and browserHistory from react-router -> | |
import { Router, Route, IndexRoute, browserHistory } from 'react-router'; | |
// Grab Navigation, signin and resource components --> | |
import Navigation from '../components/navigation'; | |
import SignIn from '../components/signin'; |
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'; | |
// Grab the {createContainer} from react-meteor-data pckg and react-router pckg | |
import { createContainer } from 'meteor/react-meteor-data'; | |
import { browserHistory } from 'react-router'; | |
// Wrap our component in a function with the ComposedComponent as an argument | |
// ComposedComponent is the component to be rendered | |
export default function(ComposedComponent) { | |
class RequireAuth extends Component { |
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
// Grab the react and react-dom pkgs --> | |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
// Grab Router, Route and browserHistory from react-router -> | |
import { Router, Route, IndexRoute, browserHistory } from 'react-router'; | |
// Grab Navigation, signin and resource components --> | |
import Navigation from '../components/navigation'; | |
import SignIn from '../components/signin'; |
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 processData(input) { | |
let lines = input.split('\n'); | |
let arr = lines[1].split(' '); | |
let k = lines[0].split(' ')[1]; // No of spins | |
let n = arr.length; | |
for (var i = 2, l = lines.length; i < l; i++) { // First two lines are for k, n and arr so let's skip em | |
let pos = (n + (lines[i] - (k % n))) % n; // This does the magic! | |
console.log(arr[pos]); | |
} |
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 main() { | |
var x1_temp = readLine().split(' '); | |
var x1 = parseInt(x1_temp[0]); | |
var v1 = parseInt(x1_temp[1]); | |
var x2 = parseInt(x1_temp[2]); | |
var v2 = parseInt(x1_temp[3]); | |
// return NO, if the first or second kangaroo is far ahead of each other. | |
if ((x2 > x1 && v2 > v1) || (x1 > x2 && v1 > v2)) { | |
console.log("NO"); |
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 fs = require('fs'); | |
// string generated by canvas.toDataURL() | |
let img = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0" | |
+ "NAAAAKElEQVQ4jWNgYGD4Twzu6FhFFGYYNXDUwGFpIAk2E4dHDRw1cDgaCAASFOffhEIO" | |
+ "3gAAAABJRU5ErkJggg=="; | |
// Grab the extension of the file | |
let ext = img.split(';')[0].match(/jpeg|png|gif/)[0]; |