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
const mariadb = require('mariadb') | |
const { Sequelize, DataTypes } = require('sequelize') | |
const mariadb1010conf = { host: 'localhost', port: 21103, username: 'sequelize_test', user: 'sequelize_test', password: 'sequelize_test', dialect: 'mariadb', database: 'sequelize_test'} | |
const mariadb103conf = { host: 'localhost', port: 21104, username: 'sequelize_test', user: 'sequelize_test', password: 'sequelize_test', dialect: 'mariadb', database: 'sequelize_test'} | |
async function testJSON (conn) { | |
await conn.query('USE sequelize_test') |
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 Sequelize = require('sequelize') | |
// TRY WITH sqlite AND with mariadb | |
// const sequelize = new Sequelize('sqlite:///tmp/test.sqlite', { logging: false }) | |
const sequelize = new Sequelize('mariadb://root:xxxx@localhost:3306/test', { logging: false }) | |
const Post = sequelize.define('Post', { | |
title: { type: Sequelize.STRING, allowNull: false } | |
}, { timestamps: false }) |
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
if (window.cordova) { | |
document.addEventListener('deviceready', start, false) | |
} else { | |
window.addEventListener('load', start, false) | |
} |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
{"0.9072737902973232":"-----BEGIN PGP PUBLIC KEY BLOCK-----\r\nCharset: UTF-8\r\n\r\nxv8AAABSBAAAAAATCCqGSM49AwEHAgMEN/PSERu++Ql+ge9HMDmYWm8kJ9OFdISy\r\ns3JTBrYyHLieGbPp38/4S4d91zdLYZZIzWaYhg1hGpUISV0hw9c+Ss3/AAAACDxn\r\naXRodWI+wv8AAACOBBATCABA/wAAAAWCV7zQtP8AAAACiwn/AAAACZBqB23/LvfZ\r\nvv8AAAAFlQgJCgv/AAAABJYDAQL/AAAAApsD/wAAAAKeAQAAGSIA/iJQMIcg4dGL\r\nEeI4KhrK/QrowWA1skDuNnXvEQKJsneaAP4nmoDCVjXSWdCwMQKvZGL9nfpbGgDB\r\n2YcGLIUhte8Xyc7/AAAAVgQAAAAAEggqhkjOPQMBBwIDBPV+yqHNCpxRNdyiuo+3\r\n6gxHUijQRIXhM/IpS/B3KsPpTcOvKAv9dHHS03bwGj20zQlRThJvxpPuqlVhrB1V\r\nJTUDAQgHwv8AAABtBBgTCAAf/wAAAAWCV7zQtP8AAAAJkGoHbf8u99m+/wAAAAKb\r\nDAAADHIA/jxbFOjjbL8BkR3kBei/SNOeP4WFpg71Pt4x+QyVxoQzAQCs7pCXG+wN\r\nvS47VkS/XJxEBWHKl4ZzVonXf6zp7m3FFA==\r\n=Lata\r\n-----END PGP PUBLIC KEY BLOCK-----\r\n"} |
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
#!/usr/bin/env bash | |
# Mass convert PDF to png | |
# settings | |
pdf_path=. | |
png_path=images | |
# check if destination path exists | |
if [ ! -d $png_path ]; then | |
mkdir $png_path |
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
10 // we are going to use an LCD and the cheap DHT11 sensor | |
11 #include <LiquidCrystal.h> | |
12 #include <dht11.h> | |
13 | |
14 // sensor on A0 | |
15 dht11 DHT11; | |
16 #define SENSOR_PIN A0 | |
17 | |
18 // pin connected to relay | |
19 #define RELAY_PIN 2 |