Skip to content

Instantly share code, notes, and snippets.

View LintangWisesa's full-sized avatar
🍔
Udah makan blon?

Lintang Wisesa LintangWisesa

🍔
Udah makan blon?
View GitHub Profile
@LintangWisesa
LintangWisesa / fire.html
Created September 12, 2019 07:21
Firebase SDK
<!-- The core Firebase JS SDK is always required and must be listed first -->
<script src="https://www.gstatic.com/firebasejs/6.6.0/firebase-app.js"></script>
<!-- TODO: Add SDKs for Firebase products that you want to use
https://firebase.google.com/docs/web/setup#config-web-app -->
<script>
// Your web app's Firebase configuration
var firebaseConfig = {
apiKey: "abcdefghijklmnopqrstuvwxyz",
@LintangWisesa
LintangWisesa / app.js
Created September 12, 2019 07:31
Express app
var express = require('express')
var bodyParser = require('body-parser')
var cors = require('cors')
var routeSaya = require('./route/route')
var app = express()
app.use(cors())
app.use(bodyParser.json())
app.use(routeSaya)
@LintangWisesa
LintangWisesa / route.js
Created September 12, 2019 07:33
Express route
var router = require('express').Router()
var fire = require('./fire')
var bodyParser = require('body-parser')
var db = fire.firestore()
router.use(bodyParser.json())
router.get('/data', (req, res)=>{
db.settings({
timestampsInSnapshots: true
})
@LintangWisesa
LintangWisesa / fire.js
Created September 12, 2019 07:34
Firebase Config
var firebase = require('firebase')
var config = {
apiKey: "abcdefghijklmnopqrstuvwxyz",
authDomain: "lintangwisesa.firebaseapp.com",
databaseURL: "https://lintangwisesa.firebaseio.com",
projectId: "lintangwisesa",
storageBucket: "lintangwisesa.appspot.com",
messagingSenderId: "1234567890",
appId: "0:1234567890:web:1234567890abcde"
@LintangWisesa
LintangWisesa / LineChart.js
Created October 11, 2019 09:26
React Native Chart Kit - #1 Line Chart
<LineChart
data={{
labels: ["Januari", "Februari", "Maret", "April", "Mei", "Juni"],
datasets: [
{
data: [
Math.random() * 100,
Math.random() * 100,
Math.random() * 100,
Math.random() * 100,
@LintangWisesa
LintangWisesa / BezierLineChart.js
Created October 11, 2019 09:27
React Native Chart Kit - #2 Bezier Line Chart
<LineChart
data={{
labels: ["Januari", "Februari", "Maret", "April", "Mei", "Juni"],
datasets: [
{
data: [
Math.random() * 100,
Math.random() * 100,
Math.random() * 100,
Math.random() * 100,
@LintangWisesa
LintangWisesa / BarChart.js
Created October 11, 2019 09:28
React Native Chart Kit - #3 Bar Chart
<BarChart
data={{
labels: ["Januari", "Februari", "Maret", "April", "Mei", "Juni"],
datasets: [
{
data: [
Math.random() * 100,
Math.random() * 100,
Math.random() * 100,
Math.random() * 100,
@LintangWisesa
LintangWisesa / StackBarChart.js
Created October 11, 2019 09:29
React Native Chart Kit - #4 Stacked Bar Chart
<StackedBarChart
data={{
labels: ["Test1", "Test2"],
legend: ["L1", "L2", "L3"],
data: [[60, 60, 60], [30, 30, 60]],
barColors: ["#dfe4ea", "#ced6e0", "#a4b0be"]
}}
width={Dimensions.get("window").width - 50} // from react-native
height={220}
yAxisLabel={"Rp"}
@LintangWisesa
LintangWisesa / PieChart.js
Created October 11, 2019 09:30
React Native Chart Kit - #5 Pie Chart
<PieChart
data={
[
{
name: "Jawa Barat",
population: 48.0,
color: "rgba(131, 167, 234, 1)",
legendFontColor: "white",
legendFontSize: 11
},
@LintangWisesa
LintangWisesa / App.js
Created October 11, 2019 09:30
React Native Chart Kit - #0 Import
import {
LineChart,
BarChart,
PieChart,
ProgressChart,
ContributionGraph,
StackedBarChart
} from "react-native-chart-kit";