Navigation Menu

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",
  • 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 / 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;
@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 / json-sort-by-key.js
Created September 8, 2018 21:02
Sort a JSON Array by a key
function GetSortOrder(prop) {
return function(a, b) {
if (a[prop] > b[prop]) {
return 1;
} else if (a[prop] < b[prop]) {
return -1;
}
return 0;
}
}
@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: {
@ianfabs
ianfabs / Vinyl.vue
Created September 9, 2018 23:37
A CSS, JS, and HTML Turntable
<template>
<div id="root">
<center>
<div id="turntable">
<div id="table-shadow"></div>
<div id="table-feet"></div>
<div id="wood">
<div id="grain1"></div>
<div id="grain2"></div>
<div id="grain3"></div>