Skip to content

Instantly share code, notes, and snippets.

View charlesroper's full-sized avatar
🌱

Charles Roper charlesroper

🌱
View GitHub Profile
function countup (n) {
console.log(`we are in ${arguments.callee.name}(${n})`);
console.log(`is ${n} < 1?`, n < 1);
if (n < 1) {
console.log(`so we're going to return [] back to the caller\n↓`);
return [];
}
console.log(`so we call countup(${n-1})\n↓`);
@charlesroper
charlesroper / wslton.omp.json
Last active February 26, 2021 23:11
Oh my Posh 3 custom theme - wslton. Based on negligible.
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"segments": [
{
"type": "os",
"style": "plain",
const express = require("express");
const fetch = require("node-fetch");
const cors = require("cors");
const app = express();
const NYT = {
endpoint: "https://api.nytimes.com/svc/topstories/v2/",
apiKey: process.env.NYT_API_KEY
};
# Know the id of the username in the original distro that was exported
wsl -d Ubuntu-20.04 -u charlesr -e id -u
# Outputs 1000
# Knowing the id of the username in the distro that was created by importing the tar image
wsl -d UbuntuShropBot -u charlesr -e id -u
# Outputs 1000
# I would want to use this distroname and id, to set this user as the default login profile of WSL.
# I set this up in Windows Registry with the line snippet below:
@charlesroper
charlesroper / bigr2.html
Last active December 6, 2020 03:22
brc-atlas-bigr test
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>brc-atlas-bigr test</title>
<script src="https://unpkg.com/brc-atlas-bigr/dist/bigr.min.umd.js"></script>
<script src="https://unpkg.com/file-saver@2.0.5/dist/FileSaver.js"></script>
</head>
@charlesroper
charlesroper / All non-FSC users not enrolled on any courses.sql
Created October 13, 2020 19:00
All non-FSC users not enrolled on any courses
SELECT DISTINCT
u.id,
u.username,
u.firstname,
u.lastname,
u.email
FROM
mdl_user u
LEFT JOIN mdl_user_enrolments e ON u.id = e.userid
LEFT JOIN mdl_role_assignments a ON u.id = a.userid
@charlesroper
charlesroper / responsive-youtube.html
Last active August 22, 2020 10:20
Responsive YouTube embed
<!--
- Replace the standard youtube.com domain with youtube-nocookie.com for enhanced performance and privacy
- Add ?rel=0 to the end of the URL to remove suggested videos
-->
<div class="embed-responsive embed-responsive-16by9">
<iframe src="https://www.youtube-nocookie.com/embed/djV11Xbc914?rel=0"
class="embed-responsive-item"
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen
@charlesroper
charlesroper / responsive-vimeo.html
Last active October 21, 2021 12:12
Responsive Vimeo embed
<!--
NOTE: YOU DO NOT NEED TO USE THIS EMBED CODE ANY MORE BECAUSE VIMEO NOW DIRECTLY SUPPORTS
RESPONSIVE EMBEDS. PLEASE SEE THEIR OWN GUIDANCE FOR DETAILS:
https://vimeo.zendesk.com/hc/en-us/articles/360000710167-Accessing-and-editing-embed-codes
-->
<div class="embed-responsive embed-responsive-16by9">
<iframe src="https://player.vimeo.com/video/448801636"
class="embed-responsive-item"

Installation

Via Chocolatey:

choco install fileoptimizer -y

Via Scoop:

scoop install fileoptimizer