Skip to content

Instantly share code, notes, and snippets.

View barelyhuman's full-sized avatar

Siddharth Gelera (reaper) barelyhuman

View GitHub Profile
@barelyhuman
barelyhuman / *vim.md
Last active April 25, 2023 02:19
self sufficient single Vim file for a minimal, portable vim

Vim Portable Config

The above config is single file for portability between environments.

Here's dependents that you need to set it up

macOS

@barelyhuman
barelyhuman / hide-explorer-arrows-vscode.sh
Created August 12, 2022 13:32
hide arrows for an icon them in vscode
#!/usr/bin/env bash
ext_root="$HOME/.vscode/extensions/"
cd $ext_root
extension_dir=$(ls . | grep miguelsolorio.symbols)
cd $extension_dir
jq -n -f ./src/symbol-icon-theme.json | cat > .tmp
npx json -I -e "this.hidesExplorerArrows=true;" -f .tmp
mv ./src/symbol-icon-theme.json ./src/symbol-icon-theme.json.bak
mv .tmp ./src/symbol-icon-theme.json
@barelyhuman
barelyhuman / gray-palette.json
Created July 31, 2022 14:22
my gray palette
[
{
"name": "gray-100",
"color": "rgba(25, 24, 21, 1)"
},
{
"name": "gray-75",
"color": "rgba(113, 113, 113, 1)"
},
{
@barelyhuman
barelyhuman / boring.itermcolors
Created July 25, 2022 11:47
iterm colors based on Plastic Theme + RSMS Gray colors
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.44705882668495178</real>
with (import <nixpkgs> {});
with (import /home/maarten/code/nixos/yarn2nix { inherit pkgs; });
let
gems = bundlerEnv {
name = "project-name";
inherit ruby;
gemdir = ./.;
};
in stdenv.mkDerivation {
name = "project-name";
@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
@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 / cgitzinc.css
Last active February 13, 2022 13:08
css for cgit for git.reaper.im
@import url("https://unpkg.com/[email protected]/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 / setup.sh
Last active June 4, 2024 11:44
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 / 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)}