Skip to content

Instantly share code, notes, and snippets.

View deblnia's full-sized avatar

Deblina Mukherjee deblnia

View GitHub Profile
set number
:augroup numbertoggle
: autocmd!
: autocmd BufEnter,FocusGained,InsertLeave,WinEnter * if &nu && mode() != "i" | set rnu | endif
: autocmd BufLeave,FocusLost,InsertEnter,WinLeave * if &nu | set nornu | endif
:augroup END
setlocal spell spelllang=en_us
syntax on
@deblnia
deblnia / petebutbot.py
Created January 2, 2025 02:54
Some of the code behind @petebutbot
# I scraped exisisting tweets using R
# library(rtweet)
# library(tidyverse)
# petey <- get_timeline("PeteButtigieg", n = 3200, include_rts = FALSE, exclude_replies = FALSE)
# petey %>%
# select(text) %>%
# rename(tweets = text) %>%
@deblnia
deblnia / .zshrc
Last active January 29, 2025 21:38
Macbook 2024 zshrc
autoload -Uz vcs_info
precmd() {
vcs_info
# Define the prompt
# %F{cyan} for cyan username, %f to reset color
# %F{blue}%~%f shows the current path in blue
# %F{green} for git branch/status with indicators in parentheses
PROMPT='%F{cyan}%n%f:%F{blue}%~%f$ %F{green}${vcs_info_msg_0_}%f '
}
@deblnia
deblnia / better-motherfucking-website.css
Last active June 14, 2024 03:43
this is my design system tbh
body {
margin: 40px auto;
max-width: 650px;
line-height: 1.6;
font-size: 18px;
color: #444;
padding: 0 10px
}
h1,
@deblnia
deblnia / rc_pairprogramming.py
Last active April 12, 2024 01:07
For the Recurse Center pair programming interview
'''
Write code that takes some Lisp code and returns an abstract syntax tree. The AST should represent the structure of the code and the meaning of each token. For example:
>> "(first (list 1 (+ 2 3) 9))"
["first", ["list", 1, ["+", 2, 3], 9]]
During your interview, you will pair on writing an interpreter to run the AST. You can start by implementing a single built-in function (for example, +) and add more if you have time.
TODO:
[] Feels like there should be a better way to test
[] Implement eval
# Write a program that prints out the numbers 1 to 100 (inclusive).
# If the number is divisible by 3, print Crackle instead of the number.
# If it's divisible by 5, print Pop.
# If it's divisible by both 3 and 5, print CracklePop.
# You can use any language.
cracklepop <- function(x){
if(x %% 3 == 0 && x %% 5 == 0){
return("CracklePop")
@deblnia
deblnia / upload_csv_to_notion.py
Created January 23, 2023 15:30
Uploads a CSV to Notion
import pandas as pd
import numpy as np
import requests
import dotenv
import json
import os
dotenv.load_dotenv()
NOTION_TOKEN = os.getenv("NOTION_TOKEN", "")
@deblnia
deblnia / librarythings.py
Last active December 31, 2021 20:14
My (naive?) implementation of the LibraryThings Programming Quiz (https://thingology.librarything.com/2011/07/the-librarything-programming-test/)
str = '''Coding tests irritate a minority of people. One applicant said his resume should speak for itself. I have no time for that attitude—though I’m happy for the weeding help. Good programmers should welcome the opportunity to demonstrate they’re good at what they do. Heck, most programmers I know enjoy brain teasers anyway. They test themselves when no one’s looking.'''
# first pass -- o(n2) time complexity solution
words = str.split(' ')
chars = 0
for word in words:
clean = word.strip('\n').strip('.')
@deblnia
deblnia / appscript.gs
Created August 27, 2021 00:43
A little Google Apps Script that parses and adds data to a Google Sheet
function onOpen() {
SpreadsheetApp.getUi() // Or DocumentApp or SlidesApp or FormApp.
.createMenu('Add CRH Notes')
.addItem('Enter CRH Notes', 'addCRHnotes')
.addToUi();
}
function showPrompt() {
var ui = SpreadsheetApp.getUi(); // Same variations.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ANSIBlackColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKMHCA9VJG51bGzTCQoLDA0OVU5TUkdCXE5TQ29sb3JTcGFjZVYkY2xhc3NPECcw
LjExNzY0NzA1ODggMC4xMjk0MTE3NjQ3IDAuMTUyOTQxMTc2NQAQAYAC0hAREhNaJGNs
YXNzbmFtZVgkY2xhc3Nlc1dOU0NvbG9yohIUWE5TT2JqZWN0XxAPTlNLZXllZEFyY2hp