Skip to content

Instantly share code, notes, and snippets.

View synicalsyntax's full-sized avatar

synicalsyntax

  • 04:18 (UTC +08:00)
View GitHub Profile
@synicalsyntax
synicalsyntax / updatePortfolioWebsites.js
Created September 10, 2022 22:16
Automatically populate portfolio repositories with their GitHub Pages URLs
const { Octokit } = require("@octokit/rest");
const octokit = new Octokit({
auth: "[REDACTED]", // provide a personal access token with read:org, repo scopes
});
async function main() {
const org = '61040-fa22';
const repos = await octokit.paginate('GET /orgs/{org}/repos', { org }, r => r.data.filter(repo => repo.name.startsWith('portfolio') && !repo.homepage).map(r => r.name));
for (const repo of repos) {
@synicalsyntax
synicalsyntax / covidpass.sh
Last active October 15, 2021 05:46
curl commands for MIT covidpass forms
# replace [INSERT-TOKEN-HERE] with your actual OAuth token (obtain from checking request headers in browser Network tab)
# attestation
curl 'https://api.mit.edu/pass-v1/pass/attestations' -X POST -H 'authorization: Bearer [INSERT-TOKEN-HERE]' -H 'content-type: application/json' --data-raw '{"answers":[{"id":"14","checked":false},{"id":"16","checked":true},{"id":"18","checked":false}]}'
# unobserved test
# replace XXXXXXXXXX with the 10 numerical digits on your test barcode
curl 'https://api.mit.edu/medical-v1/unobserved/complete' -X POST -H 'authorization: Bearer [INSERT-TOKEN-hERE]' -H 'content-type: application/json' --data-raw '{"barcode":"D-XXXXXXXXXX"}'
@synicalsyntax
synicalsyntax / hexToHsl.js
Last active October 4, 2018 20:35
Script to replace all hex strings in a folder with HSL equivalent values
/*
* hexToHsl
* Usage: FILEPATH='./static/styles' LENGTH=6 node hextohsl.js
* Author: Cynthia Lin
* License: MIT
*/
const fs = require('fs');
const hexLengths = {
'3': {
@synicalsyntax
synicalsyntax / stylish.css
Created October 18, 2017 01:06
Zulip dark theme with Stylish
body,
#tab_bar_underpadding {
background-color: #222;
color: #444;
}
hr.date-line {
border-top: 1px solid #555;
border-bottom: 1px solid #666;
}
.header {

Keybase proof

I hereby claim:

  • I am synicalsyntax on github.
  • I am synicalsyntax (https://keybase.io/synicalsyntax) on keybase.
  • I have a public key whose fingerprint is 2F7D B7E2 C625 F923 1A13 30C2 332A 4E8B 8DD6 5496

To claim this, I am signing this object:

@synicalsyntax
synicalsyntax / csc_python_challenge_solutions.py
Last active December 15, 2016 20:17
CAMSCSC Python programming challenges + solutions (12/8/16)
"""
CAMSCSC Python Programming Challenge Solutions
These are some possible solutions for the Python programming challenges presented at the CAMSCSC meeting on 12/8/16.
For more info about the challenges, read the Markdown document below.
"""
from random import randint # imports random.randint() for StatGeneration()
def number(n): # Perfect Squares challenge solution
squares = [] # define an array that will contain all the squares you generate