Skip to content

Instantly share code, notes, and snippets.

View ahkohd's full-sized avatar
🔨
Building

Victor Aremu ahkohd

🔨
Building
View GitHub Profile
@p1mo
p1mo / tauri-stronghold-plugin.md
Last active February 22, 2024 23:45
Example for Tauri's stronghold plugin

example for tauri's stronghold-plugin

First go to plugin docs and add it to your project

Aragon create used: https://crates.io/crates/rust-argon2

src-tauri/main.rs

@MatteoJoliveau
MatteoJoliveau / flake.nix
Created September 26, 2022 17:01
Nix shell for Tauri projects
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
@abemedia
abemedia / codesign.yml
Created April 3, 2021 15:35
github actions macos codesign
- name: Setup codesign
env:
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
KEYCHAIN_NAME: hello
KEYCHAIN_PWD: hello
run: |
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
security create-keychain -p $KEYCHAIN_PWD $KEYCHAIN_NAME
security default-keychain -s $KEYCHAIN_NAME
@ahkohd
ahkohd / enable-chromium-two-fingers-swipe-navigation.bash
Last active July 13, 2020 08:22
Code snippet to enable two-finger swipe gesture for next/previous page navigation for Chromium based browsers on macOS.
appName="TypeTheNameOfTheChromiumBaseBrowserInstalledOnYourMacHere"
bundleID=$(osascript -e 'id of app "'$appName'"')
defaults write $bundleID AppleEnableSwipeNavigateWithScrolls -bool TRUE
@ahkohd
ahkohd / disable-chromium-two-fingers-swipe-navigation.bash
Last active March 30, 2021 15:55
Code snippet to disable two-finger swipe gesture for next/previous page navigation for Chromium based browsers on macOS.
appName="TypeTheNameOfTheChromiumBaseBrowserInstalledOnYourMacHere"
bundleID=$(osascript -e 'id of app "'$appName'"')
defaults write $bundleID AppleEnableSwipeNavigateWithScrolls -bool FALSE
@ahkohd
ahkohd / disable-chromium-two-fingers-swipe-navigation-explained.bash
Last active August 10, 2023 07:15
Code snippet to disable two-finger swipe gesture for next/previous page navigation for Chromium based browsers on macOS.
# Set your app name - the Chromium Browser (i.e Chrome, Brave) in a variable.
appName="Brave"
# Get the bundle Id of the Chromium Browser, store it in a variable.
bundleID=$(osascript -e 'id of app "'$appName'"')
# Example: Get the bundle Id of Brave browser
# Returns:
# com.brave.Browser
import { remote, BrowserWindow } from 'electron';
const fadeWindowOut = (
_window: BrowserWindow,
step: number = 0.1,
fadeEveryXSeconds: number = 10
) => {
let opacity = _window.getOpacity();
const interval = setInterval(() => {
if (opacity <= 0) window.clearInterval(interval);
@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 16, 2024 21:16
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 March 6, 2024 23:45
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