Skip to content

Instantly share code, notes, and snippets.

import json
data = json.loads(
'{"tracks":[{"album":{"album_type":"single","artists":[{"external_urls":{"spotify":"https://open.spotify.com/artist/3TVXtAsR1Inumwj472S9r4"},"href":"https://api.spotify.com/v1/artists/3TVXtAsR1Inumwj472S9r4","id":"3TVXtAsR1Inumwj472S9r4","name":"Drake","type":"artist","uri":"spotify:artist:3TVXtAsR1Inumwj472S9r4"}],"available_markets":["CA","MX","US"],"external_urls":{"spotify":"https://open.spotify.com/album/1YxmW7DO2dM05gwMKTbr7l"},"href":"https://api.spotify.com/v1/albums/1YxmW7DO2dM05gwMKTbr7l","id":"1YxmW7DO2dM05gwMKTbr7l","images":[{"height":640,"url":"https://i.scdn.co/image/5b14b24dea78b0a14244ccb86f3bfd20bf77326d","width":640},{"height":300,"url":"https://i.scdn.co/image/177939e6656bd0ae46d12e1f36e9162016d28a3c","width":300},{"height":64,"url":"https://i.scdn.co/image/7b42b976267520f4dbb2f67e1baa63ca13bdbfdb","width":64}],"name":"Fake Love","type":"album","uri":"spotify:album:1YxmW7DO2dM05gwMKTbr7l"},"artists":[{"external_urls":{"spotify":"https://open.spotify.com/
@sreetamdas
sreetamdas / jinchuriki.css
Created June 9, 2021 07:04
Fork of obsidian theme by bencodezen, with slightly modified font family
/*------------- --------------------*/
/* Typography */
/*------------- --------------------*/
/*-----------------------------*/
/* Colors */
/*-----------------------------*/
/*-------------------------------------*/
/* CSS Variables */
/*-------------------------------------*/
:root {
@sreetamdas
sreetamdas / gigalith.css
Last active April 13, 2021 16:20
Obsidian theme — modified fork of https://cass.run/igneous
/*
IMPORTANT: Change the fonts on lines 29-33 to make this work the way you want!
*/
:root {
--dark0: #161616;
--dark1: #111111;
--dark2: #242424;
--dark3: #4c566a;
@sreetamdas
sreetamdas / getMDXPostsNext.tsx
Created August 15, 2020 04:13
get blog posts from MDX files into an index file
import fs from "fs";
import path from "path";
export const getPostsData = () => {
const META = /export\s+const\s+meta\s+=\s+(\{(\n|.)*?\n\})/;
const DIR = path.join(process.cwd(), "content/blog");
const files = fs.readdirSync(DIR).filter((file) => file.endsWith(".mdx"));
const postsData: Array<TBlogPost> = files
.map((file) => {
@sreetamdas
sreetamdas / a-rendezvous-with-cassidoo.md
Last active November 22, 2023 13:56
Rendezvous with Cassidoo: solutions to interview questions of the week from the [rendezvous with cassidoo newsletter](https://buttondown.email/cassidoo)

Rendezvous with Cassidoo Solutions

Solutions to the interview question of the week from the rendezvous with cassidoo newsletter

Solutions in the following languages:

  • TypeScript
  • Elixir

Inspired and forked from jda0

@sreetamdas
sreetamdas / snippets.json
Created June 10, 2020 07:53
Snippets for React Hooks
{
"React Functional Component": {
"prefix": "rfc",
"body": [
"import React from \"react\";",
"",
"const $TM_FILENAME_BASE = () => {",
"",
"\treturn (",
"\t\t${2:}",
const clipp = (error) => {
const looksLike = "Looks like you've encountered the following error:";
const largeFont = "font-size: 2em;";
const resetFont = "font-size: unset;";
const redText = "color: red;";
const resetText = "color: unset;";
const createOutline = char => {
return char.repeat((Math.max(error.message.length), looksLike.length) / 1.66)
}
@sreetamdas
sreetamdas / worker.js
Created April 21, 2020 05:31 — forked from tobiaslins/worker.js
Notion Custom Domain using Cloudflare Workers + Splitbee Analytics
const MY_DOMAIN = "help.splitbee.io"
const START_PAGE = "https://www.notion.so/splitbee/Help-Center-bbf26e2b70574901b9c98e5d11e449de"
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request))
})
const corsHeaders = {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET, HEAD, POST,PUT, OPTIONS",
@sreetamdas
sreetamdas / Slimdown.md
Created April 20, 2020 18:02 — forked from jbroadway/Slimdown.md
Slimdown - A simple regex-based Markdown parser.

Slimdown

A very basic regex-based Markdown parser. Supports the following elements (and can be extended via Slimdown::add_rule()):

  • Headers
  • Links
  • Bold
  • Emphasis
  • Deletions