Skip to content

Instantly share code, notes, and snippets.

View TheRakeshPurohit's full-sized avatar
:octocat:
Learning

Rakesh Harishbhai Purohit TheRakeshPurohit

:octocat:
Learning
View GitHub Profile
@TheRakeshPurohit
TheRakeshPurohit / safe-count-files.sh
Created August 29, 2023 08:15 — forked from l0b0/safe-count-files.sh
Count the number of files in a directory
# This works even with really weird filenames like $'--$`\! *@ \a\b\e\E\f\n\r\t\v\\\"\' '
file_count()
{
if [ ! -e "$1" ]
then
exit 1
fi
local -i files=$(find "$(readlink -f -- "$1")" -type f -print0 | grep -cz -- -)
echo $files
@TheRakeshPurohit
TheRakeshPurohit / normcore-llm.md
Created August 27, 2023 14:12 — forked from veekaybee/normcore-llm.md
Normcore LLM Reads
@TheRakeshPurohit
TheRakeshPurohit / useWebWorker.js
Created May 16, 2023 13:41
Simplifying web worker as a React hook
import { useState, useEffect } from 'react';
function useWebWorker(workerFunction) {
const [result, setResult] = useState(null);
useEffect(() => {
const worker = new Worker('worker.js', { credentials: "same-origin", name: "justCheking", type: "module" });
const handleMessage = (event) => {
const { data } = event;
Registered Name: https://zhile.io
License Key: 48891cf209c6d32bf4
@TheRakeshPurohit
TheRakeshPurohit / usePercentageColumns.js
Created August 5, 2021 11:31 — forked from adamscybot/usePercentageColumns.js
Reac table v6 percentage column width plugin hook
/**
* This plugin hook for React table provides the ability for percentage
* widths to be provided in the column definitions, whilst maintaining the
* ability to resize those columns.
*/
export const usePercentageColumns = hooks => {
hooks.useInstance.push(useInstance)
hooks.getRowProps.push(getRowStyles)
hooks.getHeaderProps.push(getHeaderProps)
hooks.getCellProps.push(getCellProps)
@TheRakeshPurohit
TheRakeshPurohit / IndianStatesDistricts.json
Created April 1, 2021 12:15 — forked from Dhaneshmonds/IndianStatesDistricts.json
Indian states, capitals and districts
{
"states": [
{
"id": "1",
"type": "Union Territory",
"capital": "Mayabunder",
"code": "AN",
"name": "Andaman and Nicobar Islands",
"districts": [
{
@TheRakeshPurohit
TheRakeshPurohit / Build.md
Created February 8, 2021 03:29 — forked from robertknight/Build.md
Minimal Webpack DllPlugin example

Compile with:

webpack --config vendor.webpack.config.js
webpack --config app.webpack.config.js

Use with the following index.html

@TheRakeshPurohit
TheRakeshPurohit / cloudSettings
Last active September 7, 2020 09:45
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-09-07T09:45:15.721Z","extensionVersion":"v3.4.3"}