Skip to content

Instantly share code, notes, and snippets.

View urcoilbisurco's full-sized avatar
🚀
Shipping

Francesco Marassi urcoilbisurco

🚀
Shipping
View GitHub Profile
# .env
GREETING=hello world
# main.ts
import { config } from "https://deno.land/x/dotenv/mod.ts";
console.log(config());
import { SmtpClient } from "https://deno.land/x/smtp/mod.ts";
const client = new SmtpClient();
await client.connect({
host: "smtp.163.com",
port: 25,
username: "username",
password: "password",
});
import { init, MongoClient } from "https://deno.land/x/[email protected]/mod.ts";
// Initialize the plugin
await init();
const client = new MongoClient();
client.connectWithUri("mongodb://localhost:27017");
const db = getClient().database("test");
const users = db.collection("users");
import { Schema } from "https://deno.land/x/nessie/mod.ts";
export const up = (scema: Schema): void => {
scema.create("users", (table) => {
table.id();
table.string("name", 100).nullable();
table.boolean("is_true").default("false");
table.custom("custom_column int default 1");
table.timestamps();
});
import { Client } from "https://deno.land/x/postgres/mod.ts";
async function main() {
const client = new Client({
user: "user",
database: "test",
host: "localhost",
port: "5432"
});
await client.connect();
import {
app,
get,
post,
redirect,
contentType,
} from "https://denopkg.com/syumai/[email protected]/mod.ts";
app(
get("/hello", () => "hello"),
@urcoilbisurco
urcoilbisurco / block12.js
Last active May 6, 2020 08:05
block12.js
const run = async () => {
console.log("Start...");
for(const food of foodArray){
const output = await AIFoodRecognition(food);
console.log(output);
}
console.log("Done!");
}
run();
const wifi = require('Wifi');
const f = new (require("FlashEEPROM"))();
//Library for instant feedback using a led
const L={
init:(pin)=>{
L.pin=pin
},
write:(w)=>{
digitalWrite(L.pin,w);
Verifying my Blockstack ID is secured with the address 19guoyEL3oWWKLAF9a1oUGGk44U9ZMA4g1 https://explorer.blockstack.org/address/19guoyEL3oWWKLAF9a1oUGGk44U9ZMA4g1
All the steps are really easy and you can find lots of guides on Internet.
Server
- install node on server (normally it's already installed, if not just follow this guide)
https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-16-04
- install mongodb
https://www.digitalocean.com/community/tutorials/how-to-install-mongodb-on-ubuntu-16-04
- install git on server