Skip to content

Instantly share code, notes, and snippets.

View therealparmesh's full-sized avatar
🦮

Parmesh Krishen therealparmesh

🦮
  • Austin, Texas
  • 20:08 (UTC -05:00)
View GitHub Profile
@therealparmesh
therealparmesh / ExtJSEventLogging.js
Last active September 1, 2017 18:53
Ext JS component-level event logging
Ext.onReady(function () {
Ext.define('Ext.override.eventLogging.Component', {
override: 'Ext.Component',
initComponent: function () {
var self = this
Ext.util.Observable.capture(self, function (eventName) {
console.log(eventName, self.getId(), self)
})
self.callParent(arguments)
}
@therealparmesh
therealparmesh / example.js
Created January 24, 2019 00:02
Redux Saga example
const { REQUEST, SUCCESS, FAILURE } = makeApiActionTypes('GET_USERS');
// register the reducer somewhere
const usersReducer = makeApiReducer({ REQUEST, SUCCESS, FAILURE });
const makeSelectUserById = id => state => state.users.byId[id];
function* getUsersSaga() {
try {
const { data } = yield call(axios, {
@therealparmesh
therealparmesh / helpers.js
Created January 26, 2019 00:10
Redux Saga helpers
import { call, cancel, fork, take } from 'redux-saga/effects';
export function takeLatestPerKey(patternOrChannel, worker, keySelector, ...args) {
return fork(function*() {
const tasks = {};
while (true) {
const action = yield take(patternOrChannel);
const key = yield call(keySelector, action);
@therealparmesh
therealparmesh / google-photos-takeout-metadata-fix.sh
Last active December 3, 2025 22:31
Google Photos Takeout Metadata Fix
exiftool -r -d %s -tagsfromfile "%d/%F.json" "-GPSAltitude<GeoDataAltitude" "-GPSLatitude<GeoDataLatitude" "-GPSLatitudeRef<GeoDataLatitude" "-GPSLongitude<GeoDataLongitude" "-GPSLongitudeRef<GeoDataLongitude" "-Keywords<Tags" "-Subject<Tags" "-Caption-Abstract<Description" "-ImageDescription<Description" "-DateTimeOriginal<PhotoTakenTimeTimestamp" "-FileCreateDate<PhotoTakenTimeTimestamp" -ext "*" -overwrite_original -progress --ext json .
@therealparmesh
therealparmesh / .eslintrc
Created November 11, 2021 03:47
ESLint configuration for React with TypeScript
{
"root": true,
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/recommended",
"plugin:import/typescript",
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:react-hooks/recommended"
@therealparmesh
therealparmesh / bear-tags-regex.txt
Created December 26, 2021 23:08
Bear tags regex
\{\\field\{\\\*\\fldinst\{HYPERLINK "bear://x-callback-url/open-tag\?name=.*"\}\}\{\\fldrslt (.*)\}\}\}
export async function retryAsync<T>(
asyncFn: () => Promise<T>,
maxRetries: number,
): Promise<T> {
let retries = 0;
while (retries < maxRetries) {
try {
return await asyncFn();
} catch (error) {
@therealparmesh
therealparmesh / slides.html
Created May 22, 2024 17:16
reveal.js boilerplate
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
/>
<title>reveal.js</title>
<link
@therealparmesh
therealparmesh / zed-vim-mode-cheatsheet.md
Created October 24, 2024 14:38
Zed vim mode cheatsheet

Zed Vim Mode Cheat Sheet

Zed's Vim mode replicates familiar Vim behavior while integrating modern features like semantic navigation and multiple cursors. This cheat sheet summarizes essential shortcuts and settings to help you navigate and edit code efficiently in Zed.


Enabling/Disabling Vim Mode

  • Enable/Disable Vim Mode: Open the command palette and use Toggle Vim Mode.
  • This updates your user settings: "vim_mode": true or false.
@therealparmesh
therealparmesh / html.ts
Last active December 6, 2024 17:33
html template
export function html(strings: TemplateStringsArray, ...expressions: string[]) {
let result = '';
for (let i = 0; i < strings.length; i++) {
result += strings[i];
if (i < expressions.length) {
result += expressions[i];
}
}
return result;
}