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
// Reference : https://github.com/rethinkdb/rethinkdb-example-nodejs/blob/master/todo-angular-express/app.js | |
#!/usr/bin/env node | |
'use strict' | |
const express = require('express') | |
const horizon = require('@horizon/server') | |
const async = require('async') | |
const r = horizon.r | |
const app = express() |
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 readline = require('readline'); | |
var google = require('googleapis'); | |
var OAuth2 = google.auth.OAuth2; | |
var CLIENT_ID = 'YOUR CLIENT ID HERE', | |
CLIENT_SECRET = 'YOUR CLIENT SECRET HERE', | |
REDIRECT_URL = 'YOUR REDIRECT URL HERE', | |
SCOPE = 'https://www.googleapis.com/auth/drive.file'; | |
var rl = readline.createInterface({ |
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
// official | |
const r = require('rethinkdb') | |
// rethinkdbdash | |
const r_not_called = require('rethinkdbdash') // Not enough... [Function: main] | |
const r_called = require('rethinkdbdash')() // OK! |
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
r = require('rethinkdb') | |
r.connect({host: 'localhost', port: 28015}, (err, conn) => { | |
if(err) throw err | |
r.db('test').tableCraete('tv_shows').run(conn, (err, res) => { | |
if(err) throw err | |
console.log(res) | |
r.table('tv_shows').insert({name: 'Star Wars'}).run(conn, (err, res) => { | |
if(err) throw err | |
console.log(res) |
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 _interopRequireWildcard(obj) { | |
if (obj && obj.__esModule) { | |
return obj; | |
} else { | |
var newObj = {}; | |
if (obj != null) { | |
for (var key in obj) { | |
if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; | |
} | |
} |
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
/* 0 */ | |
/***/ function(module, exports, __webpack_require__) { | |
'use strict'; | |
var _greet = __webpack_require__(1); | |
var greet = _interopRequireWildcard(_greet); | |
function _interopRequireWildcard(obj) { |
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 * as greet from './modules/greet' | |
greet.default() | |
greet.hello() |
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 const hello = () => { | |
console.log('hello') | |
} | |
export const yey = () => { | |
console.log('yey') | |
} | |
const greet = () => { | |
console.log('hey') |
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
/* 0 */ | |
/***/ function(module, exports, __webpack_require__) { | |
'use strict'; | |
var greet = __webpack_require__(1).default; | |
var hello = __webpack_require__(1).hello; | |
greet(); | |
hello(); |
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
const greet = require('./modules/greet').default | |
const hello = require('./modules/greet').hello | |
greet() | |
hello() |