Skip to content

Instantly share code, notes, and snippets.

View ianfabs's full-sized avatar

Ian Fabs ianfabs

View GitHub Profile
@ianfabs
ianfabs / progress-cli.js
Last active August 16, 2018 20:40
NodeJS code to copy canvas courses and show the progress
/*
*Script created by Ian Fabricatore
*Please use `node progress-cli.js "<APITOKEN>"`
with the quotes
*/
const canvas = require('canvas-api-wrapper');
const fs = require('fs');
//Set subdomain
canvas.subdomain = "neit";
@ianfabs
ianfabs / calendar.css
Last active August 17, 2018 23:15
A re-usable calendar class in plain javascript, NO jQuery, sadly ;-(
.calendar{
display: flex;
flex-direction: row;
flex-wrap: wrap;
box-shadow: 0 0 10px 5px #000;
margin: 5vh 1vw;
width: 95vw;
justify-content: flex-start;
align-content: center;
justify-items: center;
@ianfabs
ianfabs / calendar.js
Created August 17, 2018 23:52
Calendar assignment
class Calendar {
constructor(ctx = "", cb) {
this.d = document;
this.ctx = this.d.querySelector(`${ctx}.calendar`);
console.log(
"\u0040\u0041\u0055\u0054\u0048\u004F\u0052\u003D\u0049\u0041\u004E\u0046\u0041\u0042\u0053"
);
this.daysOfTheWeek = [
"Sunday",
@ianfabs
ianfabs / attach_vhd_at_startup_windows_10.md
Last active July 26, 2024 22:08
How to Automount VHD on windows 10

So here's a pretty neat thing, I use VHD's to organize the space on my computer. You can too!

  • Click Start

  • Type in the search bar "Disk par" =>

  • Click first result =>

  • In the program, click "Action" =>

@ianfabs
ianfabs / index.js
Last active May 15, 2019 05:12 — forked from JonathanMH/index.js
JSON Web Token Tutorial: Express
//Original article
//https://jonathanmh.com/express-passport-json-web-token-jwt-authentication-beginners/
//loadash is stupid bloatware stop using it
//var _ = require("lodash");
var express = require("express");
var bodyParser = require("body-parser");
var jwt = require('jsonwebtoken');
var passport = require("passport");
@ianfabs
ianfabs / esquery.js
Last active August 25, 2018 19:41
ESQuery, a lightweight alternative to jQuery for the modern ECMAScript developer. Or not... I guess
const d = window.document;
const qs = d.querySelector.bind(d);
Element.prototype.qs = Element.prototype.querySelector;
const qsa = d.querySelectorAll.bind(d);
Element.prototype.qsa = Element.prototype.querySelectorAll;
const f = window.fetch;
const newTab = uri => window.open(uri, "_target");
const redirect = uri => window.open(uri, "_self");
const ce = d.createElement.bind(d);
Element.prototype.ac = Element.prototype.appendChild;
  • Open an admin PowerShell, paste this command and go.

  • Once done, click Ctrl-Shift-Esc

  • From there, at the bottom of the window, click "OPEN SERVICES"

  • Then, Look for the entry marked "Microsoft Store Install Service"

  • Change startup type from "disabled" to "manual"

@ianfabs
ianfabs / announcement_delete.js
Created August 25, 2018 20:18
Delete all announcements in canvas. Just paste this into the dev console
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
(async()=>{
$("._3H0DcbB").click();
await sleep(1000);
$("#delete_announcements").click();
await sleep(2000);
$("#confirm_delete_announcements").click()
})();
<!DOCTYPE html>
<html>
<head>
<title>Practical</title>
<script src="https://cdn.rawgit.com/ianfabs/25d6655e92578cfb8c1ce91ff4ba0a22/raw/a2a087352a42e5732c341c3e0a41b279189d8c4a/esquery.js"></script>
<link rel="stylesheet" href="./main.css">
<script src="./main.js" defer></script>
</head>
@ianfabs
ianfabs / componentTemplate.vue
Last active September 9, 2018 08:26
Vue component template
<template>
<div id="root">
<h1>{{title}}</h1>
</div>
</template>
<script>
export default {
name: 'Component',
props: {