[](https://twitter.com/intent/tweet?text=Wow:&url=https%3A%2F%2Fgithub.com%2Fimshakil%2Fpython-sqlite-p
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
// Basic Types | |
let id: number = 5 | |
let company: string = 'Traversy Media' | |
let isPublished: boolean = true | |
let x: any = 'Hello' | |
let ids: number[] = [1, 2, 3, 4, 5] | |
let arr: any[] = [1, true, 'Hello'] | |
// Tuple |
MongoDB Crash Course 2022 < TODO: Add Video Link
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
#!/bin/sh | |
#Check the Drive Space Used by Cached Files | |
du -sh /var/cache/apt/archives | |
#Clean all the log file | |
#for logs in `find /var/log -type f`; do > $logs; done | |
logs=`find /var/log -type f` | |
for i in $logs |
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
import mongoose, {Schema} from 'mongoose' | |
export const ServiceSchema = new Schema({ | |
displayName: {type: String, required: true, unique: true} | |
}) | |
ServiceSchema.set('toObject', { | |
transform: function (doc, ret) { | |
ret.id = ret._id | |
delete ret._id |
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 express = require('express') | |
const app = express() | |
const cors = require('cors') | |
app.use(cors()) | |
// Mongoose | |
const mongoose = require('mongoose') | |
mongoose.connect('mongodb://localhost/blog', { useNewUrlParser: true, useUnifiedTopology: true }) | |
const db = mongoose.connection | |
// Listen on connection error | |
db.on('error', function (err) { |
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 express = require('express') | |
const app = express() | |
const akhbar = [] | |
app.get('/', function(req, res) { | |
const ahkbarHtml = akhbar.map(function(khabar, index) { | |
return ` | |
<a href="/${index}"><h3>${khabar.title}</h3></a> | |
<p>${khabar.content}</p> |
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 express = require('express') | |
const app = express() | |
const bodyParser = require('body-parser') | |
app.use(bodyParser.urlencoded({ extended: true })) | |
const posts = [] | |
app.get('/', function (req, res) { | |
const postsHtml = posts.map(function (post) { | |
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
const express = require('express') | |
const app = express() | |
let todos = [] | |
app.get('/', function(req, res) { | |
const todosHtml = todos.map(function(todo, idx) { | |
let status = '' | |
if (todo.done == true) { | |
status = 'checked' |
NewerOlder