Skip to content

Instantly share code, notes, and snippets.

View wildeyes's full-sized avatar
🎯
Focusing

wildeyes wildeyes

🎯
Focusing
  • TLV
View GitHub Profile
@wildeyes
wildeyes / AddBtn.tsx
Created March 15, 2024 17:52
Making dialog element return value awaitable with useImperativeHandle, dialog element, form method dialog
"use client";
import { AddPersonModal, AddPersonModalHandle } from "@/app/form";
import { useRef } from "react";
export function AddBtn() {
const ref = useRef<AddPersonModalHandle>(null);
return (
<>
@wildeyes
wildeyes / dev.culture.macos.setup.md
Last active February 5, 2023 16:21
Developer Culture: how to setup your dev env like me

De(fun)aults for macOS

  1. Settings -> Keyboard -> Input Sources:

image

2. ??? 3. profit ;)

hope you find this useful, feel free to comment asking for shit

@wildeyes
wildeyes / main.cpp
Last active December 26, 2022 23:07
LED corresponding to angle on ADXL345
#include <Arduino.h>
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_ADXL345_U.h>
#include <Adafruit_NeoPixel.h>
#include <math.h>
// adaFruit led parmeters
#define PIN 0
@wildeyes
wildeyes / config
Created July 24, 2022 08:31
Using multiple ssh identities (work github, personal github) - ~/.ssh/config
Host github.com:COMPANY/*
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_work
Host github.com:PERSONAL/*
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_personal
@wildeyes
wildeyes / whatsapp-select-all-contacts.js
Last active July 24, 2022 00:23
Userscript to select all contacts in search / group add in whatsapp
// https://gist.github.com/wildeyes/987fbb65c5135812cdeb91a1efea3653
// So, imagine you have to add 200 people to a group chat for work.
// how do you do it?
// 1. add them all via google contacts, add to their names some identifier, like GROUP
// 2. open whatsapp web, wait for contacts to sync (this could take some time)
// 3. click menu -> new group
// 4. open devtools (f12), go to console tab
// 5. copy the following script to the console and change what's inside the quotes on the following line to the identifier you chose (like GROUP) and press enter
whatsappSelectAllContacts('YOUR STRING HERE')
@wildeyes
wildeyes / open-source-ux.md
Last active March 7, 2022 12:02
List of apps I wish to have / work on an open source alternative for - because they don't get it

Open Source UX (Or skip below for a list of apps we could collaborate on)

Guys, I know we're programmers, but I feel as if the community doesn't get it. Not just code needs to be free - But UX, as well. We need to allow programmers to innovate different UIs on top of our applications. Packaging UI + Data + Platform is awesome, but it's unsustainble. We need to think bigger.

We need to separate user's data from the platform (web3-esque, but it's too complicated for me). Let people store the data wherever they want, so that they can move freely between apps. Remember email? now we're stuck with whatsapp. Whatsapp had VC funding, open source doesn't. The only way to survive is to allow interoperability. We need to separate UI from platform. Have some stock UI, and let users and power users extend the UI. It's very hard to do good UI + UX as open source. We need to first and foremost allow a community to form around our open source, so that people create their own solutions on top of ours.

I have so many q

@wildeyes
wildeyes / devtools.convert.pocket.export.js
Created September 8, 2021 13:56
Convert get pocket app export html file to JSON you can work with
// open ril_export.html, run this in dev tools, paste wherever you need
const _ = e => $$(e).map(ele => [ele.text, ele.href, ele.attributes.time_added.value, ...ele.attributes.tags.value.split(',')]);
copy({ unread: _('ul:first-of-type a'), read: _('ul:last-of-type a') })
import { onSnapshot, applySnapshot, getSnapshot } from 'mobx-state-tree';
interface PersistenceWhitelist<T> {
key: string;
getPersistence: (T) => Partial<T>;
}
/**
* Rehydrate a store from localstorage. Set up an event to persist store data to localstorage.
* @param key localstorage key
@wildeyes
wildeyes / listen.for.all.events.js
Created August 3, 2020 18:55
Catch all events from iframe
// https://www.thetopsites.net/article/50469550.shtml
Object.keys(window).forEach(key => {
if (/^on/.test(key)) {
window.addEventListener(key.slice(2), event => {
console.log(event);
});
}
});
@wildeyes
wildeyes / github-openbase-bookmarklet.js
Created July 16, 2020 19:04
Open github repo in openbase via it's npm/yarn name bookmarklet.
javascript:window.open(`https://openbase.io/js/${document.documentElement.innerText.match(/(?:(npm install)|(npm i)|(yarn add)) ([\w\-]+)/).slice(-1)}`)