Skip to content

Instantly share code, notes, and snippets.

@jainil
jainil / History|-3a561853|25nH.json
Created July 9, 2024 19:54
Visual Studio Code Settings Sync Gist
{
"breadcrumbs.enabled": false,
"editor.cursorSmoothCaretAnimation": "on",
"editor.fontFamily": "Cascadia Code, Menlo, Monaco, 'Courier New', monospace",
"editor.fontSize": 15,
"editor.minimap.enabled": false,
"editor.renderLineHighlight": "all",
"editor.scrollBeyondLastLine": false,
"editor.smoothScrolling": true,
"explorer.decorations.colors": false,
// Name: column to comma string
import "@johnlindquist/kit"
const clipboardText = await clipboard.readText();
const commaString = clipboardText.split('\n').map(p => `'${p.trim()}'`).join(',\n');
copy(commaString);
# Convert epub packages to epub files
import os
import subprocess
filenames = []
# Enter paths
path_to_files = "/Users/jainil/Downloads/epub_packages/"
path_to_output = "/Users/jainil/Downloads/epubs/"
# The Best Medium-Hard Data Analyst SQL Interview Questions
By Zachary Thomas ([zthomas.nc@gmail.com](mailto:zthomas.nc@gmail.com), [Twitter](https://twitter.com/zach_i_thomas), [LinkedIn](https://www.linkedin.com/in/thomaszi/))
**Tip: **See the Table of Contents (document outline) by hovering over the vertical line on the right side of the page
## Background & Motivation
> The first 70% of SQL is pretty straightforward but the remaining 30% can be pretty tricky.
@jainil
jainil / notion_csv_to_bookmarks_html.vba
Created October 13, 2020 15:33
Convert notion links csv to importable bookmarks html
Sub Test()
RangeToHtml Range("A1:D11"), "export.html"
End Sub
Sub RangeToHtml(rng As Range, fileName As String)
Dim resBeg As String
resBeg = ""
double quotes is inserted with chr(34)
For i = 2 To rng.Rows.Count
resBeg = resBeg _
@jainil
jainil / settings.json
Last active July 3, 2020 13:46
vscode settings
{
"telemetry.enableTelemetry": false,
"telemetry.enableCrashReporter": false,
"workbench.editor.enablePreview": false,
"workbench.colorTheme": "Dark+ Tweaked",
"editor.minimap.enabled": false,
"editor.fontFamily": "Jetbrains Mono Medium, Consolas, 'Courier New', monospace",
"editor.fontSize": 13,
"terminal.integrated.fontSize": 13,
"workbench.activityBar.visible": true,
// referenced from https://css-tricks.com/snippets/css/complete-guide-grid/
// column, float, clear and vertical-align have no effect on grid container
.grid-container {
display: grid | inline-grid | subgrid;
grid-template-columns: 40px 50px auto 50px 40px;
grid-template-rows: 25% 100px auto;
.flex-container {
display: flex | inline-flex;
flex-direction: row | row-reverse | column | column-reverse;
flex-wrap: wrap | nowrap | wrap-reverse;
// flex-flow: row nowrap; // flex-direction, flex-wrap
justify-content: flex-start | flex-end | center | space-between | space-around;
align-content: flex-start | flex-end | center | baseline | stretch;
align-items: flex-start | flex-end | center | space-between | space-around | stretch;
@jainil
jainil / coursera_notes_merge.sh
Last active November 24, 2016 20:33
merge all the notes downloaded by coursera-dl into one file
# http://askubuntu.com/questions/564775/how-to-merge-the-pdf-files-from-all-subdirectories
# http://stackoverflow.com/questions/15617016/cp-copy-all-files-with-a-certain-extension-from-all-subdirectories
# create a temp dir to contain all the notes
mkdir all_notes
# recursively find all pdfs and copy to the temp dir
find . -name \*.pdf -exec cp {} all_notes \;
# conatenate with pdftk
@jainil
jainil / tmux-cheatsheet.markdown
Created June 10, 2016 12:18 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname