Skip to content

Instantly share code, notes, and snippets.

View privateOmega's full-sized avatar
🎮
Focusing

Kiran Mathew Mohan privateOmega

🎮
Focusing
  • Hinge Health
  • Bangalore, India
  • 12:05 (UTC +05:30)
View GitHub Profile
@privateOmega
privateOmega / mac-setup.sh
Created December 13, 2024 16:12
mac-setup.sh
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew update
brew doctor
# oh my zsh with some plugins and themes
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
sed -i '' 's/^ZSH_THEME=.*/ZSH_THEME="agnoster"/g' ~/.zshrc
sed -i '' 's/^plugins=.*/plugins=(colored-man-pages colorize nvm)/g' ~/.zshrc
@privateOmega
privateOmega / ordinal-date.js
Created March 13, 2023 07:34
luxon with ordinal date
import { DateTime } from "luxon";
function ordinal(n) {
const s = ["th", "st", "nd", "rd"];
const v = n % 100;
return n + (s[(v - 20) % 10] || s[v] || s[0]);
}
const linkExpiryDate = DateTime.now().plus({ days: 1 });
@privateOmega
privateOmega / rewire.js
Last active January 31, 2023 11:23
rewiring webpack config in react-scripts
const rewire = require('rewire');
const defaults = rewire('react-scripts/scripts/build.js');
const { RetryChunkLoadPlugin } = require('webpack-retry-chunk-load-plugin');
const config = defaults.__get__('config');
/**
* Do not mangle component names in production, for a better learning experience
* @link https://kentcdodds.com/blog/profile-a-react-app-for-performance#disable-function-name-mangling
*/
@privateOmega
privateOmega / gist:907eaaa824193a64aed34ac0e552230f
Created October 20, 2022 07:28
changing ssh keys of ec2 instance
`ssh-keygen` or if key was generated on aws console `ssh-keygen -y -f ~/Downloads/private-key.pem` to get the public key
copy public key to `.ssh/authorized_keys`
`sudo reboot`
`ssh server1`
@privateOmega
privateOmega / assertions.js
Created October 18, 2022 07:15
const assertions
// ref: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-4.html
const status = ['on', 'off'] as const;
type status = typeof status[number];
@privateOmega
privateOmega / install-redis.sh
Last active July 12, 2022 12:50 — forked from felipecsl/install-redis.sh
Installing Redis 6.x.x on Amazon Linux
#!/bin/bash
###############################################
# To use:
# chmod +x install-redis.sh
# ./install-redis.sh
###############################################
version=6.2.7
@privateOmega
privateOmega / .vimrc
Created July 6, 2022 18:20
vim dot file
set number
@privateOmega
privateOmega / .zshrc
Created July 6, 2022 15:40
fix for terraform init failing
export TF_REGISTRY_CLIENT_TIMEOUT=20
@privateOmega
privateOmega / .zshrc
Created June 23, 2022 04:34
zsh prompt for displaying git branch
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
setopt PROMPT_SUBST
PROMPT='%9c%{%F{green}%}$(parse_git_branch)%{%F{none}%} $ '
@privateOmega
privateOmega / enzyme_render_diffs.md
Created June 22, 2022 09:44 — forked from fokusferit/enzyme_render_diffs.md
Difference between Shallow, Mount and render of Enzyme

Shallow

Real unit test (isolation, no children render)

Simple shallow

Calls:

  • constructor
  • render