Skip to content

Instantly share code, notes, and snippets.

View khalby786's full-sized avatar
donuts

Khaleel Gibran khalby786

donuts
View GitHub Profile
@khalby786
khalby786 / style.css
Created April 9, 2024 16:32
Aesthetically pleasing Stylus fixes for the Glitch editor dark mode
:root {
--fonts-mono: "Hack", "Fira Code", "Fira Mono", monospace;
--fonts-sans: -apple-system, BlinkMacSystemFont, "Inter V", "Segoe UI Variable Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}
html {
--theme-ui-colors-gray-2: gray;
}
.CodeMirror * {
@khalby786
khalby786 / userscript.js
Created October 1, 2022 11:28
Force Instagram dark mode using Tampermonkey
// ==UserScript==
// @name Instagram Force Dark Mode
// @namespace https://khaleelgibran.com
// @version 0.1
// @description Append dark mode param to Instagram URLs!
// @author Khaleel Gibran <hi@khaleelgibran.com>
// @match https://www.instagram.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=instagram.com
// @grant none
// ==/UserScript==
@khalby786
khalby786 / style.css
Last active August 6, 2022 14:05
CSS uploaded by scrapbook.hackclub.com/customizer
@import url("https://cdn.jsdelivr.net/npm/hack-font@3/build/web/hack.css");:root { --fonts-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; --fonts-display: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; --fonts-mono: 'Hack', 'SF Mono', 'Roboto Mono', Menlo, Consolas, monospace;}.header-links{ margin-top: 20px;}.react-calendar-heatmap { display: none;}.posts { display: block; max-width: 600px;}.post-header { --colors-text: gray;}.post { line-height: 1.5; background-color: var(--colors-background); padding-top: 50px; padding-bottom: 50px; padding-left: 0px; padding-right: 0px; font-family: var(--fonts-mono);}.post-attachment { text-align: left;}.post { border: none !important;}
@khalby786
khalby786 / cargo.toml
Last active May 20, 2022 04:36
Move a triangle around your screen with Rust OpenGL ft. Glium, Glutin
[package]
name = "rust-opengl"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
glium = "*"
@khalby786
khalby786 / massDeleteAssets.js
Last active January 2, 2022 13:07
Userscript that deletes *all* the assets in your Glitch project
// ==UserScript==
// @name Glitch Delete All Assets
// @namespace http://khaleelgibran.com/
// @version 0.1
// @description mass-deletes your glitch project's assets
// @author Khaleel Gibran <khalby786@gmail.com>
// @match https://glitch.com/edit/*
// @icon https://glitch.com/favicon.ico
// @run-at document-start
// ==/UserScript==
@khalby786
khalby786 / public.pgp
Created December 30, 2021 05:45
My public PGP key
-----BEGIN PGP PUBLIC KEY BLOCK-----
Comment: https://keybase.io/download
Version: Keybase Go 5.9.0 (windows)
xsFNBGHNPPwBEADz8me1t4WAsXYhuYlhCzrdxtqRJBKGcSLejeX99UegpAPkgEuu
w+ub8OxV+RK871QLbefr0rxwSkcrU1h1FfDOgt/reXH6rSHtGndC/ZHgHfB/JKyR
oOXUZZLzq+FW17RoJmrPRwJziJILfPsz6cgK1QNpOVozyupV99R4Y62L3xlP0+cC
z/+0ZPf7A0Sjq5jdfPD6xLk781up3LTQuCAb1acK/5cNjMcwChQrsG0Jt2u0QYeW
fwohj6MhoauF0fdZq2hDGJHL63Tf66dkvo0oIcxcZWDbMsjnYDd6Li2MJvWV74tp
/jt2aevnV9u9ybyqkv0MmYCViWEg+2M8fsfBnKyS+U/UmN7L48HPrNMdSsq8p8p5

Keybase proof

I hereby claim:

  • I am khalby786 on github.
  • I am khalby786 (https://keybase.io/khalby786) on keybase.
  • I have a public key whose fingerprint is CA79 239A C8C1 3557 574B 0947 A4F9 5479 F42A AAF5

To claim this, I am signing this object:

@khalby786
khalby786 / server.js
Created August 26, 2020 11:27
GitHub oAuth Login with Express & without Passport.js
const express = require("express");
const app = express();
var session = require('express-session');
const fetch = require('node-fetch');
const clientID = process.env.CLIENT_ID;
const clientSecret = process.env.CLIENT_SECRET;
async function getAccessToken(code, client_id, client_secret) {
const request = await fetch("https://github.com/login/oauth/access_token", {
@khalby786
khalby786 / index.md
Created June 3, 2020 15:45
HTTP ----> HTTPS Redirecting

Using client-side Vanilla JS in your browser

// https://gist.github.com/youngchief-btw/d8c327ef245f2e9998997a41c7b34e70
if (location.protocol === "http:") {
  location.replace(window.location.href.replace("http:", "https:"));
}

Use Express for Node.js