Skip to content

Instantly share code, notes, and snippets.

View barelyhuman's full-sized avatar

Siddharth Gelera (reaper) barelyhuman

View GitHub Profile
@barelyhuman
barelyhuman / vscode-v2.json
Last active June 15, 2021 12:20
Version 2 of my current base vscode settings
{
// Theme and Layout settings
"workbench.colorTheme": "Vitesse Light",
"workbench.iconTheme": "quill-icons-minimal",
"workbench.productIconTheme": "icons-carbon",
"editor.renderIndentGuides": false,
"editor.renderWhitespace": "none",
"editor.minimap.renderCharacters": false,
"workbench.startupEditor": "none",
"workbench.sideBar.location": "right",
@barelyhuman
barelyhuman / main.js
Created June 29, 2021 20:52
Make API calls synchronous in web workers using atomics
// Simple js file that index.html has as a script src or the entry file of the app
let worker = new Worker("worker.js");
worker.postMessage({
url: "https://jsonplaceholder.typicode.com/todos/1",
});
@barelyhuman
barelyhuman / vscode-minimal.json
Last active October 4, 2023 09:33
vscode-minimal.json
{
"editor.quickSuggestionsDelay": 1000,
"editor.suggestOnTriggerCharacters": false,
"editor.lightbulb.enabled": false,
"editor.selectionHighlight": true,
"editor.occurrencesHighlight": true,
"editor.formatOnSave": true,
"editor.fontFamily": "Hermit",
"editor.fontSize": 13.5,
"editor.formatOnPaste": false,
{
"basics": {
"name": "Reaper ⠀",
"label": "Better at talking to computers than humans.",
"picture": "",
"email": "sidgel95@gmail.com",
"phone": "9885317891",
"website": "",
"summary": "Minimalist • Developer • I build stuff • https://barelyhuman.dev • https://reaper.im",
"location": {
@barelyhuman
barelyhuman / goblin.sh
Last active January 15, 2022 10:04
simple wrapper around https://goblin.reaper.im for smaller shell scripts
goblin () {
curl -sf "https://goblin.reaper.im/$1@$2" | sh
$($3)
}
@barelyhuman
barelyhuman / button-click.js
Created January 15, 2022 10:49
button clicker snippet
function lk(e,l){var a=0,c=setInterval(()=>a<=l?(e.click(),a++):clearInterval(c),1e3)}
@barelyhuman
barelyhuman / setup.sh
Last active September 9, 2023 18:56
Setup NGINX + CGIT on a Ubuntu 20.04
#!/bin/bash
set -euxo pipefail
# Configurations
# the new user that's to be added for logging in (comment out `create_user` from the `main` if you already have a admin user)
NEW_USER="admin"
DUMMY_PASS="dummyPassword123"
# your public key to be replaced here
@barelyhuman
barelyhuman / cgitzinc.css
Last active February 13, 2022 13:08
css for cgit for git.reaper.im
@import url("https://unpkg.com/zinccolors@0.0.1/css/zinc.min.css");
@import url("https://rsms.me/inter/inter.css");
html,
body {
padding: 0;
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
}
@barelyhuman
barelyhuman / script.js
Created April 16, 2022 23:56
wonka (wonka.kitten.sh) , custom operators code
import { fromArray, fromValue, pipe, toPromise } from "wonka";
function talkbackPlaceholder(a) {}
const customTake = (max) => (source) => (sink) => {
let taken = [];
let talkback = talkbackPlaceholder;
let ended = false;
return source((signal) => {
if (typeof signal === "number") {
@barelyhuman
barelyhuman / availability_function.sql
Created June 2, 2022 08:14
get open time slots for bookings where bookings can be overlapped if there's more than one slot for booking (postgres)
-- table structure for reference
-- `areas`
-- column type nullable
-- ------------------------------
-- id int4 NO
-- name varchar(11) YES
-- slots int4 NO
--
-- `avail`
-- column type nullable