Skip to content

Instantly share code, notes, and snippets.

View hardik-vala's full-sized avatar

Hardik hardik-vala

  • San Francisco Bay Area
View GitHub Profile
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 007b5ee..00088e8 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -63,7 +63,7 @@ devDependencies:
version: 14.0.0(react-dom@18.2.0)(react@18.2.0)
'@testing-library/user-event':
specifier: ^14.4.3
- version: 14.4.3(@testing-library/dom@9.2.0)
+ version: 14.4.3(@testing-library/dom@9.3.0)

Using only Sheets

  1. Copied the text from https://www.sfchronicle.com/newsroom_contacts/ to an empty Google spreadsheet.
  2. Split the names by comma using the "Split text to columns" feature, recorded in a macro so I can apply it using a keyboard shortcut.
  3. Used this formula to format as rows, =CONCATENATE("03/26/2023,Hardik,",B44,",",A44,",",A46,",,,San Francisco Chronicle,",A45)
  4. Then copied it over to another sheet, splitting the text into columns.
  5. Sorted the columns to move the interspersed empty rows.

Using ChatGPT

@hardik-vala
hardik-vala / Dockerfile
Created May 9, 2022 13:28
Dockerfile for running containerized Remix daemon
FROM node:latest
EXPOSE 65520
EXPOSE 65523
EXPOSE 65522
ENV PROJECT_DIR="/root/project"
WORKDIR $PROJECT_DIR
COPY . $PROJECT_DIR
@hardik-vala
hardik-vala / python_selenium_install_macos.md
Created November 18, 2020 14:59
How to install Selenium for Python on macOS

Install selenium for Python 3,

pip3 install selenium

Install chromedriver,

brew tap homebrew/cask
@hardik-vala
hardik-vala / CircBufferRunner.java
Last active May 12, 2021 14:19
Simple Java implementation of a circular buffer allowing appends and removes.
import java.util.Arrays;
import java.util.Scanner;
/**
* Runs commands for circular buffer
* @author Hardik Vala
*/
class CircBufferRunner {
@hardik-vala
hardik-vala / translate_to_eng_synsets.py
Created August 18, 2016 04:24
Simple script to translate each (English) token in a text file to its WordNet synset (using the NLTK API)
"""
Translates each token in a text file to its WordNet synset.
@author: Hardik
"""
import argparse
import logging
import os
import re
@hardik-vala
hardik-vala / sol_to_davids_cl_puzzler.sc
Last active June 26, 2016 15:41
Scala solution to David's command-line puzzler for the April 17th (2015) NDG meeting (Description in the file).
import java.io.File
/*
* Problem description: Given a .tsv file where the first column is a tweet’s text content, the second
* column is the user id who made the tweet, and the third column is the lat lon of the tweet (if any),
* with a space in between the values how would you find the most frequently used hashtag for each user
* who has tweeted more than five times and has at least one tweet from in the continental US?
*/
val inputPath: String = "/home/ndg/project/jurgens/command-line-demo/command-line-challenge-input.BIG.tsv"
@hardik-vala
hardik-vala / user_map_dockerfile
Last active May 16, 2016 22:19
Dockerfile showing how to map a user from the host system to a Docker container (sometimes necessary for folder mounts to work).
# Demo Dockerfile illustrating how to map a user from the host system to the
# Docker container.
# Here are some simple instructions to get up and running:
#
# Build the image with,
#
# docker build -t myDockerImage .
#
# and then build a container with a folder mount using,
@hardik-vala
hardik-vala / universal_exception_handler.js
Created May 5, 2016 03:05
The one Javascript exception handler to rule them all.
/* I did not come up this but can't find the proper source. */
try {
// Some shiz.
} catch (e) {
var xcb="http://stackoverflow.com/search?q=[js]" + e.message;
window.open(xcb, '_blank');
}
@hardik-vala
hardik-vala / sms-decorator.py
Created May 1, 2016 04:42
Example illustrating how to use a decorator to notify you via text message if a long running function crashes.
"""
Example illustrating how to use a decorator to notify you via text message if a
long running function crashes.
"""
import os
import time
# Phone number (You may want to change this).