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
# .env | |
GREETING=hello world | |
# main.ts | |
import { config } from "https://deno.land/x/dotenv/mod.ts"; | |
console.log(config()); |
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
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", | |
}); |
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
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"); |
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
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(); | |
}); |
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
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(); |
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
import { | |
app, | |
get, | |
post, | |
redirect, | |
contentType, | |
} from "https://denopkg.com/syumai/[email protected]/mod.ts"; | |
app( | |
get("/hello", () => "hello"), |
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
const run = async () => { | |
console.log("Start..."); | |
for(const food of foodArray){ | |
const output = await AIFoodRecognition(food); | |
console.log(output); | |
} | |
console.log("Done!"); | |
} | |
run(); |
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
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); |
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
Verifying my Blockstack ID is secured with the address 19guoyEL3oWWKLAF9a1oUGGk44U9ZMA4g1 https://explorer.blockstack.org/address/19guoyEL3oWWKLAF9a1oUGGk44U9ZMA4g1 |
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
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 |
NewerOlder