Skip to content

Instantly share code, notes, and snippets.

View ahkohd's full-sized avatar
🔨
building

Victor Aremu ahkohd

🔨
building
View GitHub Profile
@olayemii
olayemii / code.js
Last active April 15, 2020 20:23
A simple helper function for getting deeply nested object property
const getObjectProperty = (obj, path, defaultValue="", returnUndefined=true) => {
const checkForDefaultValue = value =>
value !== undefined ? value : undefined;
if (path === undefined) {
return obj;
}
try {
const value = path.split('.').reduce((o, i) => o[i], obj);
if (value === undefined && returnUndefined) return value;
@bbqtd
bbqtd / macos-tmux-256color.md
Last active July 13, 2026 23:39
Installing tmux-256color for macOS

Installing tmux-256color for macOS

  • macOS 10.15.5
  • tmux 3.1b

macOS has ncurses version 5.7 which does not ship the terminfo description for tmux. There're two ways that can help you to solve this problem.

The Fast Blazing Solution

Instead of tmux-256color, use screen-256color which comes with system. Place this command into ~/.tmux.conf or ~/.config/tmux/tmux.conf(for version 3.1 and later):

@enepomnyaschih
enepomnyaschih / base64.js
Last active October 22, 2025 23:55
https://www.npmjs.com/package/byte-base64 - Encode JS Uint8Array, simple array of bytes or native JS string to base64 and back
/*
MIT License
Copyright (c) 2020 Egor Nepomnyaschih
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@andersevenrud
andersevenrud / alacritty-tmux-vim_truecolor.md
Last active July 26, 2026 21:52
True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

This should make True Color (24-bit) and italics work in your tmux session and vim/neovim when using Alacritty (and should be compatible with any other terminal emulator, including Kitty).

Testing colors

Running this script should look the same in tmux as without.

curl -s https://gist.githubusercontent.com/lifepillar/09a44b8cf0f9397465614e622979107f/raw/24-bit-color.sh >24-bit-color.sh
function ObjectToUrlEncode(data)
{
return Object.entries(data).reduce((accumulator, current) => {
return `${accumulator}&${current[0]}=${current[1]}`;
}, '').substring(1);
}
console.log(ObjectToUrlEncode({name: "victor", age: 12, line: 13}));
// OUTPUT: "name=victor&age=12&line=13"
@quaternioninterpolation
quaternioninterpolation / ImageDOCrossfade.cs
Last active February 25, 2026 12:15
DOTween UnityEngine.UI.Image image cross fade
/** --
** Copyright (C) 2019 by Josh van den Heever
**
** Permission is hereby granted, free of charge, to any person obtaining a copy of
** this software and associated documentation files (the "Software"), to deal in
** the Software without restriction, including without limitation the rights to
** use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
** of the Software, and to permit persons to whom the Software is furnished to
** do so, subject to the following conditions:
**
@nlharri
nlharri / rxjs-eventemitter.js
Last active April 13, 2026 11:04
RxJS Tutorial - Event Emitter for Node JS
var EventEmitter = require('events').EventEmitter;
const { Observable, fromEvent } = require('rxjs');
var emitter = new EventEmitter();
var source = fromEvent(emitter, 'data');
var subscription = source.subscribe(
(x) => console.log('Next: ' + x),
(err) => console.log('Error: ' + err),
@denisgolius
denisgolius / generate-ssh-key.sh
Created October 4, 2018 06:55 — forked from grenade/01-generate-ed25519-ssh-key.sh
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/mozilla_rsa
@golanlevin
golanlevin / sketch.js
Created September 30, 2018 01:43
PoseNet skeletons with ml5.js & p5.js, using a pre-loaded video
// Copyright (c) 2018 ml5
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
/* ===
ml5 Example
PoseNet example using p5.js
=== */
@BananaAcid
BananaAcid / electron_paths_compared_win_osx.txt
Last active July 14, 2023 08:20
electron paths compared - win + osx
Test App:
https://github.com/BananaAcid/Simple-Electron-Kiosk/blob/master/PATH%20RESULTS
------------------------------------------------------------------------------------
electron paths
__dirname refers to index.mjs (parallel to loader.babel.js)
Be aware of globally installed modules - for unpacked.