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><%= title %></title> | |
<script src="https://unpkg.com/[email protected]"></script> | |
<script src="https://unpkg.com/alpinejs" defer></script> | |
<link rel="stylesheet" href="/styles.css"> | |
</head> |
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
/** | |
* 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 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
<!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 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
<!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 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
/** | |
* @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 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 express = require('express'), | |
redis = require('redis'), | |
logger = require('morgan'), | |
bodyParser = require('body-parser'); | |
var client = redis.createClient(),//CREATE REDIS CLIENT | |
app = express(); | |
app.use(logger("tiny")); | |
app.use(bodyParser.urlencoded({ extended: false })) |
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 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 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
pendaftarSummary <- function(highschool) { | |
filename <- paste(highschool,".csv", sep="") | |
tmp <- read.csv(filename) | |
S <- summary(tmp$Jumlah.UN) | |
L <- length(tmp$No) | |
list(S = S, L = L) | |
} |
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 meanApp = angular.module('meanApp', ['ngRoute', 'meanControllers']); | |
meanApp.config(['$routeProvider', function($routeProvider) { | |
$routeProvider | |
.when('/', { | |
controller:'ListCtrl', | |
templateUrl:'mod_list.html' | |
}) | |
.when('/detail/:userId', { | |
controller:'DetailCtrl', |
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 mongoose = require('mongoose'); | |
var Schema = mongoose.Schema, | |
ObjectId = Schema.ObjectId; | |
// SCHEMAS | |
var User = new Schema({ | |
fullname: {type: String, required: true}, | |
email: {type: String, required: true}, | |
password: {type: String, required: true} | |
}); |
NewerOlder