Skip to content

Instantly share code, notes, and snippets.

View jpwco's full-sized avatar

John-Paul Ore jpwco

View GitHub Profile
@jpwco
jpwco / refactoring-example-1-after.js
Last active March 24, 2022 19:41
Refactoring example #1 after
class Department {
name;
printName() {
console.log("Department name: " + this.name);
}
printMeeting() {
console.log("The Accounting Department meets each Monday at 10am.");
}
@jpwco
jpwco / refactoring-example-1-before.js
Last active March 24, 2022 19:41
Refactoring example #1 before
class Department {
name;
printName() {
console.log("Department name: " + this.name);
}
}
class AccountingDepartment extends Department {
printMeeting() {
const Discord = require("discord.js");
const bot = new Discord.Client();
const TOKEN = "NOPE"
var color = require('chalk');
var fs = require('fs');
bot.on("ready", function(message) {
console.log(color.green("Online"))
})
bot.on("message", function(message){
if(userEndDate.getTime() != null
&& userEndDate.getTime() > today.getTime()
&& endDateFromRequest != null ? endDateFromRequest.getTime() !== userEndDate.getTime() : true){
//some code
}
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/html'});
res.end('Hello World!');
}).listen(8080);
@jpwco
jpwco / setup.sh
Created November 21, 2016 17:11 — forked from KCreate/setup.sh
Personal Ubuntu Setup Script
# Install git
sudo apt-get install git
sudo mkdir ~/github/
# Uninstall all previous copies of vim
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-common vim-gui-common
sudo apt-get build-dep vim-gnome
sudo apt-get install python-dev libncurses5-dev
sudo rm -rf /usr/local/share/vim
sudo rm /usr/bin/vim