Skip to content

Instantly share code, notes, and snippets.

View avinayak's full-sized avatar

Atul Vinayak avinayak

  • Hiive
  • Vancouver, BC
  • 23:30 (UTC -07:00)
View GitHub Profile
{
"a fortiori": {
"definition": "With even greater reason or force; logically, if one thing is true, then something related is *definitely* also true.",
"example_usage": "If someone with a PhD in astrophysics understands the basics of planetary motion, *a fortiori* someone with a high school physics education should also understand them.",
"related_words": "necessarily, logically, evidently"
},
"à la mode": {
"definition": "In the current fashion; stylish.",
"example_usage": "“While traditional pumpkin pie is lovely, my grandmother always serves it *à la mode* – with a generous scoop of vanilla ice cream, of course.”",
"related_words": "fashionable, trendy, stylish"
#!/usr/bin/env python3
# <xbar.title>prs</xbar.title>
# <xbar.version>v1.0</xbar.version>
# <xbar.author>Atul Vinayak</xbar.author>
# <xbar.author.github>avinayak</xbar.author.github>
# <xbar.desc>Shows a list of merged pull requests for the current user</xbar.desc>
# <xbar.dependencies>bash</xbar.dependencies>
import subprocess
@avinayak
avinayak / index.js
Created December 30, 2024 19:56
random wiki article cloudflare worker
export default {
async fetch(request) {
// Define the topics and corresponding Wikipedia random URLs
const topics = [
"https://en.wikipedia.org/wiki/Special:RandomInCategory/Data_structures",
"https://en.wikipedia.org/wiki/Special:RandomInCategory/Algorithms",
"https://en.wikipedia.org/wiki/Special:RandomInCategory/Computer_science",
"https://en.wikipedia.org/wiki/Special:RandomInCategory/Cognitive_biases",
"https://en.wikipedia.org/wiki/Special:RandomInCategory/Mathematics",
"https://en.wikipedia.org/wiki/Special:RandomInCategory/Data_structures",
@avinayak
avinayak / test.css
Last active September 16, 2024 21:42
.forge-page {
background: red;
}
@avinayak
avinayak / audit_log.sql
Created June 6, 2023 23:05
Automated jsonb audit_log generator for all tables in current schema
CREATE TABLE audit_log (
id serial PRIMARY KEY,
object_id uuid NOT NULL,
object_type VARCHAR(50),
event VARCHAR(50),
delta JSONB,
timestamp TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
);
@avinayak
avinayak / jvoc.json
Created September 4, 2022 20:48
jvoc.json
[
{
"w": "あっち",
"k": "",
"k_en": "",
"m": "over there",
"wt": "Pronoun",
"j": 5,
"i": 1,
"c": "w"
@avinayak
avinayak / japanese_vocab_study_order.json
Created September 4, 2022 19:40
japanese_vocab_study_order.json
This file has been truncated, but you can view the full file.
{
"あっち": {
"index": 3,
"word": "あっち",
"kana": "",
"romaji": "",
"type": "Pronoun",
"jlpt": 5,
"meaning": "over there",
"card": "word",
@avinayak
avinayak / cron.exs
Created May 16, 2022 06:51
A interval cron thing in genserver
defmodule Cron do
use GenServer
@name __MODULE__
def start_link(initial_map) do
GenServer.start_link(__MODULE__, initial_map, name: @name)
end
def add_job(key, job, interval) do
GenServer.cast(@name, {:add_job, {key, job, interval}})
@avinayak
avinayak / hello.exs
Last active May 15, 2022 09:30
Simplest plug based http sever
# run with $ elixir --no-halt hello.exs
Mix.install([{:plug_cowboy, "~> 2.0"}])
defmodule HWPlug.Plug do
import Plug.Conn
def init(options), do: options
def call(conn, _opts) do
conn