Skip to content

Instantly share code, notes, and snippets.

View santhosh-chinnasamy's full-sized avatar

Santhosh C santhosh-chinnasamy

View GitHub Profile
santhosh-chinnasamy / .gitconfig
Last active April 9, 2024 10:02
[includeIf "gitdir/i:~/"] # Personal
path = ~/.git-personal.conf
[includeIf "gitdir:~/Workspace/"]
path = ~/.git-tw.conf
[includeIf "gitdir:~/Workspace/apollo-io/"]
path = ~/.git-apollo.conf
# compress disk-space-usage by deleting dangling commits
# Note: Do not use '--all' switch for reflog expire - since that also destroys stashes
cc = "!echo \"Size before: $(du -sh .git | cut -f1)\"; git remote prune origin; git repack; git prune-packed; git reflog expire --all --expire=1.week.ago; git maintenance run --task=gc; echo \"Size after: $(du -sh .git | cut -f1)\";"
# Fig pre block. Keep at the top of this file.
[[ -f "$HOME/.fig/shell/zshrc.pre.zsh" ]] && builtin source "$HOME/.fig/shell/zshrc.pre.zsh"
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
# If you come from bash you might have to change your $PATH.
# Fig pre block. Keep at the top of this file.
[[ -f "$HOME/.fig/shell/profile.pre.bash" ]] && builtin source "$HOME/.fig/shell/profile.pre.bash"
. "$HOME/.cargo/env"
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
santhosh-chinnasamy / .aliases
Last active April 9, 2024 10:03
## source rvm
source /Users/santhosh/.rvm/scripts/rvm
alias y=yarn
alias python=python3
docker images
# brew bundle dump to generate this file
# brew outdated --greedy to check brew's with latest tag
# brew upgrade --greedy to upgrade to latest tag
# Upgrades and cleans up all regular outdated casks and libs (non-greedy)
# brew bundle check || brew bundle --all --cleanup; brew bundle cleanup -f; brew cleanup --prune=all; brew upgrade
# set arguments for all 'brew cask install' commands
cask_args appdir: '/Applications'
// Script to create a scroll to top button
// Create a button element
var scrollButton = document.createElement('button');
scrollButton.textContent = 'Shrooovvv';
scrollButton.classList.add('scroll-to-top'); // Add a class for styling
const style = {
display: "flex",
position: "fixed",
bottom: "40px",
right: "40px",
santhosh-chinnasamy / p10k.zsh
Created May 16, 2022 02:07
p10k config file
# Generated by Powerlevel10k configuration wizard on 2021-12-05 at 11:27 IST.
# Based on romkatv/powerlevel10k/config/p10k-lean.zsh, checksum 54401.
# Wizard options: nerdfont-complete + powerline, small icons, unicode, lean, 12h time,
# 1 line, compact, few icons, concise, instant_prompt=quiet.
# Type `p10k configure` to generate another config.
# Config for Powerlevel10k with lean prompt style. Type `p10k configure` to generate
# your own config based on it.
# Tip: Looking for a nice color? Here's a one-liner to print colormap.
santhosh-chinnasamy / elastic_kibana.yml
Last active January 11, 2022 13:49
Elaastic and Kibana compose files
version: "3"
image: elasticsearch:7.16.2
container_name: elasticsearch
restart: unless-stopped
- bootstrap.memory_lock=true
- discovery.type=single-node
import React from "react";
import { useQuery } from "react-query";
import axios from "axios";
import User from "./User";
export default function Users() {
const fetchUsers = async () => {
const response = await axios.get(
import React, { useState } from "react";
import { useMutation, useQueryClient } from "react-query";
import axios from "axios";
const gender = ["male", "female"];
const status = ["active", "inactive"];
const random = (array) => array[Math.floor(Math.random() * array.length)];
export default function User() {
const [name, setName] = useState("");