Skip to content

Instantly share code, notes, and snippets.

View meain's full-sized avatar

Abin Simon meain

View GitHub Profile
@meain
meain / gist:65289f299277b5c1cc81b43c6f5db2c2
Created March 14, 2023 18:40
Split join args - emacs tree-sitter
(defun meain/closest-node (nodes)
(let ((distance 999999)
(node nil)
(point (point)))
(progn
(seq-do (lambda (x)
(let* (
(range (tsc-node-byte-range (cdr x)))
(start (byte-to-position (car range)))
(end (byte-to-position (cdr range)))
@meain
meain / custom.css
Created March 2, 2023 03:28
Logseq custom CSS
/* Use this with harmony theme */
* {
/* font-family: "ProFont for Powerline" !important; */
font-family: "Labrada" !important;
font-weight: 500;
}
.block-properties {
background: none;
margin: 0;
The name Wendy was made up for the book 'Peter Pan.'
Barbie's full name is Barbara Millicent Roberts.
Every time you lick a stamp, you consume 1/10 of a calorie.
The average person falls asleep in seven minutes.
Studies show that if a cat falls off the seventh floor of a building it has about thirty percent less chance of surviving than a cat that falls off the twentieth floor. It supposedly takes about eight floors for the cat to realize what is occurring, relax and correct itself.
Your stomach has to produce a new layer of mucus every 2 weeks otherwise it will digest itself.
The citrus soda 7-UP was created in 1929; '7' was selected after the original 7-ounce containers and 'UP' for the direction of the bubbles.
101 Dalmatians, Peter Pan, Lady and the Tramp, and Mulan are the only Disney cartoons where both parents are present and don't die throughout the movie.
A pig's orgasm lasts for 30 minutes.
'Stewardesses' is the longest word that is typed with only the left hand.
@meain
meain / sharescreen
Created January 7, 2022 07:14 — forked from adrianlzt/sharescreen
Scripts to share only a portion of the screen
#!/bin/bash
# Modified version of https://github.com/Ashark/hliss/blob/master/vlc-hangouts
# Script to share a portion of the screen in VLC to be used by Chrome/Firefox to share the screen
# By default, when run, it asks to click in some window. The area of that window is what is going to be shared.
# If executed with "sharescreen area", it asks for a portion of the screen to be shared.
unset x y w h
# Old code to choose a monitor
@meain
meain / default.nix
Created October 20, 2021 15:23 — forked from hgzimmerman/default.nix
Run `nix-shell default.nix` to enable compilation to wasm.
# This works for me with cargo-web (Yew)
with import <nixpkgs> {
overlays = map (uri: import (fetchTarball uri)) [
https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz
];
};
stdenv.mkDerivation {
name = "rust-wasm";
buildInputs = [

Let me show you some code.

import os
os.environ["HOST"].startswith("linux")

Bulleted lists, cuz why not?

@meain
meain / github-compact.css
Last active November 13, 2020 03:28
Styling changes to new github to make it a bit more dense and less round
.Box,
.State,
.Label,
.IssueLabel,
.timeline-comment-label,
.form-control,
.signed-commit-badge-large,
.signed-commit-badge-medium,
.signed-commit-badge-small,
.btn {
const graph = document.getElementsByClassName("js-calendar-graph-svg")[0];
let rects = [];
const gs = document
.getElementsByClassName("js-calendar-graph-svg")[0]
.getElementsByTagName("g")[0]
.getElementsByTagName("g");
Array.from(gs).forEach(g => {
rects = [...rects, ...Array.from(g.getElementsByTagName("rect"))];
});
let rects = [];
function visualize(analyser) {
analyser.fftSize = 2048;
var bufferLength = analyser.fftSize;
var dataArray = new Uint8Array(bufferLength);
function run() {
analyser.fftSize = 2048;
var bufferLengthAlt = analyser.frequencyBinCount;
function hexToHSL(H, off) {
// Convert hex to RGB first
let r = 0,
g = 0,
b = 0;
if (H.length == 4) {
r = "0x" + H[1] + H[1];
g = "0x" + H[2] + H[2];
b = "0x" + H[3] + H[3];
} else if (H.length == 7) {