Skip to content

Instantly share code, notes, and snippets.

@liondancer
liondancer / App.js
Created August 15, 2017 09:45 — forked from crittermike/App.js
Using Google API (gapi) with React
/* global gapi */
const API_KEY = 'YOURAPIKEYHERE';
import React, { Component } from 'react';
class App extends Component {
loadYoutubeApi() {
const script = document.createElement("script");
import express from 'express';
import webpack from 'webpack';
import webpackDevMiddleware from 'webpack-dev-middleware';
import path from 'path';
import config from '../../webpack.config.dev';
import open from 'open';
/* eslint-disable no-console */
const port = 3000;
import webpack from 'webpack';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import CleanWebpackPlugin from 'clean-webpack-plugin';
export default {
entry: [
'./app/index'
],
devtool: 'inline-source-map',
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>Jifts</title>
</head>
<body>
<div id="app"></div>
<script src="./dist/bundle.js"></script>
</body>
</html>
import express from 'express';
import webpack from 'webpack';
import webpackDevMiddleware from 'webpack-dev-middleware';
import path from 'path';
import config from '../../webpack.config.dev';
import open from 'open';
/* eslint-disable no-console */
const port = 3000;
import express from 'express';
import webpack from 'webpack';
import webpackDevMiddleware from 'webpack-dev-middleware';
import path from 'path';
import config from '../../webpack.config.dev';
import open from 'open';
/* eslint-disable no-console */
const port = 3000;
const func = () => {
if (condition) {
return asyncCall().then(() => {
if (condition) {
if (condition) {
// continue looping
return func();
} else {
console.log('some logic');
}
const func = () => {
if (condition) {
return asyncCall().then(() => {
if (condition) {
if (condition) {
// continue looping
return func();
} else {
console.log('some logic');
}
@liondancer
liondancer / test.js
Created January 31, 2017 03:27
Nested while loop skeleton
const func = () => {
if (condition) {
return asyncCall().then(() => {
if (condition) {
if (condition) {
// continue looping
return func();
} else {
console.log('some logic');
}
const outerFunc = () => {
var i = 0
return new Promise(resolve => {
if (i < 3) {
i++
const innerFunc = () => {
return new Promise(resolve => {
return log.asyncCall().then(log => {
if (log) {
// some logic