Nana's Source Code repository
Ethan's Source Code repository
Table Of Contents
''' | |
Title: Variables | |
Description/Explanation/Lesson: | |
Variables in Python are defined using the '=' operator. For example: myAge = 18 | |
Variables can contain Strings, Numbers, Lists, Class Instances, and many more things! | |
Variables can also contain operations & methods i.e. eightSquared = 8 ** 2 | |
Or, binaryFromDecimal = bin(243) |
''' | |
Title: Variables | |
Description/Explanation/Lesson: | |
Variables in Python are defined using the '=' operator. For example: myAge = 18 | |
Variables can contain Strings, Numbers, Lists, Class Instances, and many more things! | |
Variables can also contain operations & methods i.e. eightSquared = 8 ** 2 | |
Or, binaryFromDecimal = bin(243) |
var moment = require('moment'); | |
function createHistoryObj(id, obj) { | |
return { | |
id, | |
...obj, | |
removed: false, | |
history: { | |
[moment().valueOf()]: { ...obj, change: "created" } | |
}, |
const fs = require("fs"); | |
fs.readFile("./install_log.log", (err, data) => { | |
if (err) throw err; | |
const s = data.toString(); | |
// prettier-ignore | |
const regex_ports = /HTTPS?_PORT\\\"\:\\\"(\d+)/g; | |
let port_match = regex_ports.exec(s); |
const fastify = require('fastify')() | |
const superPlugin = require('./superPlugin.js') | |
fastify.register(superPlugin, { | |
secretCode: 'JavaScript is awesome!' | |
}) | |
fastify.get('/', (request, reply) => { | |
reply.send({ hello: 'world' }) | |
}) |
Nana's Source Code repository
Ethan's Source Code repository
Table Of Contents
"use strict"; | |
const express = require('express'), | |
app = express(), | |
bodyParser = require('body-parser'), | |
path = require('path'), | |
favicon = require('express-favicon'), | |
passport = require('passport'), | |
LocalStrategy = require('passport-local').Strategy, | |
session = require('express-session'), |
package main | |
import ( | |
"io/ioutil" | |
"log" | |
"os" | |
) | |
func fcopy(src, dst string) { | |
content, err := ioutil.ReadFile(src) |
const { performance } = require('perf_hooks') | |
const { | |
Worker, isMainThread, parentPort, workerData, theadId, MessageChannel | |
} = require('worker_threads') | |
/* | |
* Multithreading qsort and merge sort implementation. | |
* Written by Ethan Arrowood (https://github.com/Ethan-Arrowood) in | |
* Node.js v11.2.0 | |
* |
const { | |
Worker, isMainThread, parentPort, workerData, threadId, MessageChannel | |
} = require('worker_threads') | |
//getting array from workerData | |
const array = workerData | |
// sort array | |
let sortedArray = array.sort((a, b) => a - b) | |
let thr = { | |
threadId, | |
sortedArray |