Skip to content

Instantly share code, notes, and snippets.

View Keireira's full-sized avatar
:shipit:
I believe in Ajaw supremacy

Aljóna Đukić Keireira

:shipit:
I believe in Ajaw supremacy
View GitHub Profile
@Keireira
Keireira / download.js
Created January 23, 2026 07:53
Download from Boosty
(() => {
document.querySelector('vk-video-player').store.actions.internal.downloadVideo();
})();
@Keireira
Keireira / _.sh
Created January 12, 2026 10:55
Fuck FigmaAgent.app
# removing FigmaAgent.app
rm -fr ~/Library/Application\ Support/Figma/FigmaAgent.app
# creating a dummy file
touch ~/Library/Application\ Support/Figma/FigmaAgent.app
# make the file undeletable
sudo chflags -R schg ~/Library/Application\ Support/Figma/FigmaAgent.app
# Now Figma will not be able to override that file when it wants to update it.
@Keireira
Keireira / touch_id_pam.sh
Last active January 23, 2026 07:53
touchid in terminal
sudo nano /etc/pam.d/sudo
# add to top of the file:
auth sufficient pam_tid.so
import type { ObjectStr } from '@src/types';
import { ALLOWED_METHODS } from './requestKeys';
export type BackendError = {
status: number
error: string
name?: string
attributes?: ObjectStr
}
import cloneDeep from 'lodash/cloneDeep';
const replaceNull = (value) => (value === '') ? null : value;
const proxyHandler = {
get(target, key, receiver) {
const value = Reflect.get(target, key, receiver);
const nullifiedValue = replaceNull(value);
const useOnScreen = (ref: ObjectRef, rootMargin: number = 0) => {
const ioSupported = 'IntersectionObserver' in window
const [visible, setVisible] = useState(false)
/* fallback for browsers with no IntersectionObserver support */
useOnScreenFallback({ ref, ioSupported, setVisible })
useEffect(() => {
if (!ioSupported) {
return
@Keireira
Keireira / locations.json
Last active March 21, 2024 11:40
Locations for DaData API search queries
{
"moscow": [
{
"country": "Россия",
"region": "Московская",
"region_type_full": "область"
}, {
"country": "Россия",
"region": "Москва",
"region_type_full": "город"
// @flow
export type PromiseHandler = {
promise: Promise<*>,
cancel: () => void,
}
export default function makeCancelable(promise: Promise<*>): PromiseHandler {
let hasCanceled = false
[
{ "alpha2": "AB", "name": "Абхазия", "numeric": "999" },
{ "alpha2": "AU", "name": "Австралия", "numeric": "36" },
{ "alpha2": "AT", "name": "Австрия", "numeric": "40" },
{ "alpha2": "AZ", "name": "Азербайджан", "numeric": "31" },
{ "alpha2": "AL", "name": "Албания", "numeric": "8" },
{ "alpha2": "DZ", "name": "Алжир", "numeric": "12" },
{ "alpha2": "AS", "name": "Американское Самоа", "numeric": "16" },
{ "alpha2": "AI", "name": "Ангилья", "numeric": "660" },
{ "alpha2": "AO", "name": "Ангола", "numeric": "24" },
const comparatorF = (element, needle) => element - needle
const binarySearch = (list, needle, comparator = comparatorF) => {
if (!needle || !list) return null
let min = 0
let max = list.length - 1
while (min <= max) {
const mid = Math.floor(min + (max - min) / 2)