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
  • 17:37 (UTC +05:30)
View GitHub Profile
@Schm1tz1
Schm1tz1 / macbook-setup-confluent.sh
Last active July 17, 2025 07:19
Example MacBook Setup Script for Confluent with a lot of useful tools
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# oh my zsh with some plugins and themes
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
sed -i '' 's/^ZSH_THEME=.*/ZSH_THEME="wezm+"/g' ~/.zshrc
sed -i '' 's/^plugins=.*/plugins=(ansible brew common-aliases colorize docker git github history kubectl)/g' ~/.zshrc
# sdkman
curl -s "https://get.sdkman.io" | bash
@maxrodrigo
maxrodrigo / install-chrome-headless.sh
Last active September 18, 2025 12:26
Puppeteer/Chrome Headless on EC2 Amazon Linux AMI
#!/bin/env bash
# Install 3rd party repositories
sudo rpm -ivh --nodeps http://mirror.centos.org/centos/7/os/x86_64/Packages/atk-2.22.0-3.el7.x86_64.rpm
sudo rpm -ivh --nodeps http://mirror.centos.org/centos/7/os/x86_64/Packages/at-spi2-atk-2.22.0-2.el7.x86_64.rpm
sudo rpm -ivh --nodeps http://mirror.centos.org/centos/7/os/x86_64/Packages/at-spi2-core-2.22.0-1.el7.x86_64.rpm
# Install dependencies
sudo yum install -y nodejs gcc-c++ make cups-libs dbus-glib libXrandr libXcursor libXinerama cairo cairo-gobject pango libXScrnSaver gtk3
@djgrant
djgrant / commands.sh
Created March 18, 2018 18:18
Prettier without destroying git history
git filter-branch --tree-filter 'prettier --write "**/**.js" || echo “Error formatting, possibly invalid JS“' -- --all
git filter-branch --tree-filter '\
prettier --no-config --single-quote --tab-width=4\
--print-width=110 --write "**/**.js" || \
echo “Error formatting, possibly invalid JS“' -- --all
@fokusferit
fokusferit / enzyme_render_diffs.md
Last active September 19, 2025 19:40
Difference between Shallow, Mount and render of Enzyme

Shallow

Real unit test (isolation, no children render)

Simple shallow

Calls:

  • constructor
  • render
@stigok
stigok / githook.js
Last active August 8, 2025 08:55
Verify GitHub webhook signature header in Node.js
/*
* Verify GitHub webhook signature header in Node.js
* Written by stigok and others (see gist link for contributor comments)
* https://gist.github.com/stigok/57d075c1cf2a609cb758898c0b202428
* Licensed CC0 1.0 Universal
*/
const crypto = require('crypto')
const express = require('express')
const bodyParser = require('body-parser')
@tacionery
tacionery / postgres_guide
Last active January 25, 2019 22:05
install postgresql on antergos
# uninstall postgresql if necessary
$ sudo pacman -R postgresql postgresql-libs
# remove postgres files
$ sudo rm -rfv /var/lib/postgres
# proceed with the installation
$ sudo pacman -S postgresql postgresql-libs
# setup password for postgres
$ sudo passwd postgres
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@chad3814
chad3814 / gist:2924672
Last active August 29, 2024 05:43
deleting array items in javascript with forEach() and splice()
// This is from my comment here: http://wolfram.kriesing.de/blog/index.php/2008/javascript-remove-element-from-array/comment-page-2#comment-466561
/*
* How to delete items from an Array in JavaScript, an exhaustive guide
*/
// DON'T use the delete operator, it leaves a hole in the array:
var arr = [4, 5, 6];
delete arr[1]; // arr now: [4, undefined, 6]