This file contains 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
/** | |
* @author Arie M. Prasetyo | |
*/ | |
const mongoose = require('mongoose'); | |
const mongoConfig = {useNewUrlParser: true, useUnifiedTopology: true}; | |
// connect to Mongo database | |
mongoose.connect('mongodb://localhost:27017/test', mongoConfig); | |
// define the model |
This file contains 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> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta name="author" content="Galenic"> | |
<script src="js/knockout-2.1.0.js"></script> | |
<link rel="stylesheet" href="pure-min.css"> | |
<link rel="stylesheet" href="custom.css"> | |
<title>Node Showcase</title> |
This file contains 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
/** | |
* Example of a simple data request to a Google Sheet spreadsheet. | |
* Requirements: | |
* 1. Make sure the spreadsheet is public | |
* 2. Get an API key from Google Developer Console | |
*/ | |
const axios = require('axios'); | |
const apiKey = "YOUR_GOOGLE_DEVELOPER_API_KEY"; |
This file contains 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> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta name="author" content="Galenic"> | |
<script src="js/jquery-1.9.1.js"></script> | |
<script src="js/knockout-2.1.0.js"></script> | |
<script src="js/Chart.js"></script> | |
<link rel="stylesheet" href="pure-min.css"> |
This file contains 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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Local storage</title> | |
<style> | |
body { | |
font-family: Arial, Helvetica, sans-serif; |
This file contains 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 lang="en"> | |
<head> | |
<title>Beams SDK integration</title> | |
</head> | |
<body> | |
<h1>Beams SDK integration</h1> | |
<!-- Install the SDK --> | |
<script src="https://js.pusher.com/beams/1.0/push-notifications-cdn.js"></script> |
This file contains 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 page = require('webpage').create(); | |
var url = 'http://phantomjs.org/quick-start.html'; | |
//SPECIFY VIEWPORT SIZE OF THE SCREENCAPTURE | |
page.viewportSize = { | |
width: 1280, | |
height: 900 | |
}; |
This file contains 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> | |
<script src="js/jquery-1.9.1.js"></script> | |
<script src="js/knockout-2.1.0.js"></script> | |
<script src="js/Chart.js"></script> | |
</head> | |
<body> | |
<div> |
This file contains 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
from elasticsearch import Elasticsearch | |
es = Elasticsearch() | |
res = es.get(index="belajar", doc_type='pesan', id=1) | |
print(res['_source']) |
This file contains 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
<audio id="audioplayer" controls="controls" autoplay="autoplay" data-bind="attr:{src: selectedFile}"></audio> | |
<p>Selected song: <span id="audioplayer" data-bind="text: selectedSong"></span></p> | |
<img data-bind="attr:{src: selectedCover}" width="200"/> | |
<tbody data-bind="foreach: availableSongs"> | |
<tr> | |
<td data-bind="text: artist"></td> | |
<td><img data-bind="attr:{src: cover}" width="60"/> <span data-bind="text: album"></span></td> | |
<td data-bind="text: title"></td> | |
<td><a href="#" data-bind="click: $root.selectSong">PLAY</a></td> |
NewerOlder