Skip to content

Instantly share code, notes, and snippets.

View afflicted-cat's full-sized avatar
🏠
Working from home

C4T afflicted-cat

🏠
Working from home
View GitHub Profile
@afflicted-cat
afflicted-cat / gist:ba4cd6da9d7d4f05da04001428402c62
Last active May 5, 2022 14:55
$ANDROID_SDK_ROOT on MacOS with Fish shell
First :
$ touch ~/.config/fish/config.fish; nano ~/.config/fish/config.fish
Copy this in the file :
set --export ANDROID_SDK_ROOT $HOME/Library/Android/sdk;
set -gx PATH $ANDROID_SDK_ROOT/emulator $PATH;
set -gx PATH $ANDROID_SDK_ROOT/platform-tools $PATH;
@afflicted-cat
afflicted-cat / run-emulator.fish
Last active May 5, 2022 14:57
Fish function to run android emulator on MacOSX
function run-emulator --argument emulator
echo launch android emulator $emulator
$ANDROID_SDK_ROOT/emulator/emulator -avd $emulator -no-snapshot > /dev/null 2>&1 &
end
@afflicted-cat
afflicted-cat / attach-hmr.ts
Created May 24, 2020 08:33
effector-next & hmr
function attachHMR(domain: Domain) {
if (typeof window === "undefined") return;
const states = window.__EFFECTOR_STATES__ = {};
domain.onCreateStore((store) => {
if (!store.sid) return;
if (store.sid in states) {
const { defaultState, actual } = states[store.sid];
@afflicted-cat
afflicted-cat / gpg.txt
Last active July 28, 2021 00:52
GPG failed to sign the data
1. Update to gpg2:
brew upgrade gnupg # This has a make step which takes a while
brew link --overwrite gnupg
brew install pinentry-mac
echo "pinentry-program /usr/local/bin/pinentry-mac" >> ~/.gnupg/gpg-agent.conf
killall gpg-agent
2. Test
@afflicted-cat
afflicted-cat / babel.config.js
Last active September 27, 2021 10:01
Nextjs ssr
module.exports = (api) => {
api.cache.using(() => process.env.NODE_ENV);
return {
presets: ["next/babel"],
plugins: [["effector/babel-plugin", { reactSsr: true }]],
};
};