Skip to content

Instantly share code, notes, and snippets.

const a = 1; // put cursor here and try to move down using keys bind to `goto_next_start`'s `@function.outer`
const arrowFn = () => {
console.log('some body')
}
function regularFn() {
console.log('some content')
}
@ajitid
ajitid / bluefin-silverblue.txt
Last active January 5, 2024 05:50
fedora distro (non-wsl)
(See readme.txt as well)
Used https://github.com/ublue-os/bluefin/releases/ in VMWare Workstation
Upon installing and opening Bluefin for the first time, a popup opens up asking to install more software, I close it and wait for remaining packages to be installed. I get a notification that flatpak pkgs have been installed and see Firefox in the dock.
I do a restart
Now I run `just update`. This can fail if you don’t have enough battery or CPU. (It’ll tell you to check the logs.) Otherwise wait for like 10 mins to let it update stuff. It doesn’t show any progress bar at the moment.
Then I restart. Then I run `just devmode`. Restart again once it is done.
@ajitid
ajitid / bypass-sudo.md
Last active December 22, 2023 14:51
Copy and paste pwd (Wayland)

Read readme.md first

It might happen that the input (in which you want to fill the pwd) exist inside a popup and thus opening pkexec could close it. To resolve this we can allow ydotool to be run in w/o sudo password:

  • Execute sudo visudo -f /etc/sudoers.d/my-overrides
  • Paste in this line ajitid ALL=(ALL:ALL) NOPASSWD: /usr/bin/ydotool *
  • Save and exit. Now do sudo -l and you would see an output for ydotool
  • To check if it is working, open a new terminal window and type in sudo /usr/bin/ydotool key 56:1 62:1 62:0 56:0. Upon pressing enter it should either close the window or ask for a confirmation.
  • In clippass script, replace pkexec with sudo
@ajitid
ajitid / step-1.md
Last active May 22, 2022 05:34
Postgres setup in WSL Fedora
@ajitid
ajitid / readme.md
Last active May 17, 2022 12:12
`useEffectOnce` for React v18 (TypeScript)

Inspired from this blog post. If you want to change return type from void to unknown, be my guest.

@ajitid
ajitid / another.js
Last active May 14, 2022 14:58
sum(1)(2)(3)() - sum curry recursive like
function sum(a) {
if(a == null) return 0
return b => b == null ? a : sum(a + b)
}
/*
sum() // 0
sum(1) // 1
sum(1)(2)() // 3
@ajitid
ajitid / Button.tsx
Created April 26, 2022 05:44
React extend HTML element
import React, { forwardRef } from 'react';
import cn from 'classnames';
import css from './input.module.scss';
interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {}
const Input = forwardRef<HTMLInputElement, InputProps>(
({ type = 'text', className, ...props }, ref) => {
let classes = cn(css.input, className);
@ajitid
ajitid / instructions.md
Last active May 27, 2022 10:00
Setup Fedora on WSL
@ajitid
ajitid / a.py
Last active March 31, 2022 18:28
print("Clap along if you feel like that's what you wanna do")
call plug#begin()
Plug 'theHamsta/nvim-treesitter', {'branch': 'ecma-auto-comment', 'do': ':TSUpdate'}
call plug#end()
set fillchars=eob:\ ,
set shm+=Ic
set noswapfile
set lazyredraw
set modelines=0
set number relativenumber