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 LINE = require('./line.js'); | |
var line = new LINE(); | |
var email = 'your email'; | |
var password = 'your password'; | |
line.login(email, password, function(error, result) { | |
if (error) { | |
return; | |
} |
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 thermal_printer = require(“node-thermal-printer”); | |
var printer = require(“printer”); | |
// console.log(printer.getPrinters()) | |
var star = printer.getPrinter(‘Star_TUP992__STR_T_U001_‘); | |
thermal_printer.init({ | |
type:‘star’ | |
}) | |
thermal_printer.println(“Hello World”); |
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
//https://docs.expo.io/versions/latest/sdk/imagepicker.html | |
import React from 'react'; | |
import { TouchableOpacity, Image, View, StyleSheet, Text, Modal, Slider } from 'react-native'; | |
import { ImagePicker } from 'expo'; | |
export default class App extends React.Component { | |
constructor(props){ | |
super(props); | |
this.state = { |
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
/** | |
* Sample React Native App | |
* https://github.com/facebook/react-native | |
* @flow | |
*/ | |
import React, {Component} from 'react'; | |
import moment from 'moment'; | |
import { | |
AppRegistry, |
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
firebase.auth().signInWithCredential(credential) | |
.then((user) => { | |
console.log('facebook auth:', user); | |
this.setState({name: user.email, modalVisible: false}); | |
}) | |
.catch((error) => { | |
// Handle Errors here. | |
this.setState({name: 'Anonymous', modalVisible: true}); | |
alert("An error occured: " + error.message); | |
}); |
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 moment = require('moment'); | |
var histohour = require('./histohour.json'); | |
var stats = require("stats-lite") | |
var d = histohour.Data; | |
let h = {}; | |
for (let i=0;i<d.length;i++){ | |
let date = moment(d[i].time*1000); | |
console.log(date); | |
let hour = date.hours(); | |
let diff = d[i].close - d[i].open; |
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 Iconv = require('iconv').Iconv; | |
var conv = new Iconv('windows-874', 'utf8'); | |
var rq = require('request'); | |
rq({ | |
url: someurl | |
encoding: 'binary' | |
}, function (error, resp, body) { | |
body = new Buffer(body, 'binary'); | |
body = conv.convert(body).toString(); |
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
let rootURL = 'https://www.omdbapi.com/'; | |
exports.search = function(q){ | |
let url = `${rootURL}?apikey=3f1288a7&s=${q}`; | |
console.log(url); | |
return fetch(url) | |
.then((resp)=>resp.json()) | |
.then((json)=>{ | |
return json.Search; | |
}); |
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 node:9 | |
MAINTAINER Kobkrit | |
LABEL "version"="1.0.0" | |
RUN npm install -g ionic cordova | |
RUN mkdir -p /var/www/app | |
WORKDIR /var/www/app |
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
// See https://github.com/dialogflow/dialogflow-fulfillment-nodejs | |
// for Dialogflow fulfillment library docs, samples, and to report issues | |
'use strict'; | |
const functions = require('firebase-functions'); | |
const {WebhookClient} = require('dialogflow-fulfillment'); | |
const {Card, Suggestion} = require('dialogflow-fulfillment'); | |
process.env.DEBUG = 'dialogflow:debug'; // enables lib debugging statements | |
OlderNewer