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 redis = require("redis"); | |
const redis_url = process.env.REDIS_URL || null; | |
const client = redis.createClient(redis_url); | |
module.exports = { | |
getCached: (req, res, next) => { | |
const { redis_key } = req.headers | |
client.get(redis_key, function(err, reply) { | |
if (err) { |
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
runtime: nodejs | |
env: flex |
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
{ | |
"name": "travis-ci", | |
"version": "0.0.0", | |
"private": true, | |
"scripts": { | |
"start": "node ./bin/www", | |
"test": "mocha --exit" | |
}, | |
"dependencies": { | |
"body-parser": "~1.18.2", |
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 chai = require('chai'); | |
const chaiHttp = require('chai-http'); | |
const app = require('../app') | |
const expect = chai.expect | |
chai.use(chaiHttp) | |
describe('App', () => { | |
it('should run without any problem', () => { |
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
// The Vue build version to load with the `import` command | |
// (runtime-only or standalone) has been set in webpack.base.conf with an alias. | |
import Vue from 'vue' | |
import App from './App' | |
import router from './router' | |
Vue.config.productionTip = false | |
Vue.use(require('vue-shortkey')) | |
/* eslint-disable no-new */ |
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
<template> | |
<div class="container"> | |
<div class="playboard"> | |
<div class="duren" :style="{ 'margin-left': marginLeftDuren + '%', 'top': 'calc(' + marginTopDuren + '% - 20px)' }"></div> | |
</div> | |
<div class="controller"> | |
<div class="bucket" :style="{ 'margin-left': marginLeft + '%', 'margin-top': marginTopBucket + '%'}"> | |
</div> | |
<button v-shortkey="['arrowleft']" @shortkey="moveLeft" @click="moveLeft"class="button">Kiri</button> | |
<button v-shortkey="['arrowright']" @shortkey="moveRight" @click="moveRight " class="button">Kanan</button> |
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 { createStore } from 'redux' | |
import reducer from './reducer' | |
const store = createStore(reducer) | |
export default store |
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
class Car { | |
constructor(color) { | |
this.color = color | |
} | |
} | |
const car = new Car('merah') | |
console.log(car.color) |
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
class Car { | |
constructor() { | |
this._color = null | |
} | |
get color () { | |
return `Warna Mobilnya adalah ${this._color}` | |
} |
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
class Car { | |
constructor(type, color) { | |
this.type = type | |
this.color = color | |
this.engineStatus = 'off' | |
} | |
engineStart () { | |
NewerOlder