Skip to content

Instantly share code, notes, and snippets.

// Credits: https://www.geeksforgeeks.org/how-to-get-the-full-url-in-expressjs/
const express = require('express');
const app = express();
const PORT = 3000;
app.get('*', function (req, res) {
const protocol = req.protocol;
const host = req.hostname;
const url = req.originalUrl;
<meta name="viewport" content="width=device-width, initial-scale=1">
@BlazerYoo
BlazerYoo / index.html
Created August 2, 2022 21:19
tornado
<!DOCTYPE html>
<html>
<head>
<title>Chat application</title>
</head>
<body>
<div style="width:100%; padding: 20px; overflow-y: scroll;">
<div id="messages"></div>
<div style="padding-top: 20px;">
<form onsubmit="return sendMessage()">
echo " __ __ __ __ ___ __ __ __ __ __ _____ __ "
echo "/ / \(_ _) /| / |__)|_ |__)/ \ (_ |_ | / \|__) "
echo "\__\__/__) /__ | / | \ |__| \__/ __)|__ | \__/| "
echo
echo
# $1 - github username
# $2 - name of COS217 template repo
# $3 - name of your private github repo
@BlazerYoo
BlazerYoo / bulma-setup.sh
Created April 1, 2023 04:11
Use bash script to set up node-sass for Bulma (adapted from https://bulma.io/documentation/customize/with-node-sass/)
echo 'MAKING BULMA DIRECTORY...'
mkdir bulma-sass
cd bulma-sass
echo $'\nSpecify entry point: sass/styles.scss'
echo $'\nINITIALIZING NPM PROJECT...'
npm init
echo $'\nINSTALLING DEPENDENCIES...'
npm install node-sass --save-dev
@BlazerYoo
BlazerYoo / modern-hosting-2021.md
Created April 4, 2023 22:46 — forked from wiverson/modern-hosting-2021.md
List of free hosting services (that also offer options to scale up for $) in 2021

Italics means the text/description is directly from the vendor, usually the slug line on their home page.

Non-italics means it's my comments/editorial.

Static Sites

  • Surge
    • Static web publishing for Front-End Developers
    • Simple, single-command web publishing. Publish HTML, CSS, and JS for free, without leaving the command line.
@BlazerYoo
BlazerYoo / java.sh
Created May 13, 2023 02:37
Compile and execute Java programs in one line
#!/bin/bash
# Compile Java program
javac $1.java
# Check if compilation was successful
if [ $? -eq 0 ]; then
# Execute Java program with command line arguments
java $1 "${@:2}"
from IPython.display import JSON
from google.colab import output
from subprocess import getoutput
import os
def shell(command):
if command.startswith('cd'):
path = command.strip().split(maxsplit=1)[1]
os.chdir(path)
return JSON([''])
window.addEventListener('beforeunload', (event) => {
// Cancel the event as stated by the standard.
event.preventDefault();
// Chrome requires returnValue to be set.
event.returnValue = '';
});

Princeton University COS 217: Introduction to Programming Systems Git and GitHub Primer

Introduction

This document describes how the concepts of version control and file sharing are implemented in Git and GitHub.

For any project involving multiple developers, or even any suitably large one-developer project, it quickly becomes unwieldy and error-prone to maintain multiple stable and developmental versions of the codebase at once. Further, it requires great discipline to consistently document changes to the codebase in order to recall how things were before. To help with managing, and even automating, these necessities of large-scale software development, software engineers use version control systems .

Git is one mainstream example of a version control system. Using Git you create source code repositories, which are collections of your project data paired with metadata that tracks changes to that data over time. GitHub is an Internet service for hosting Git repositories (one of man