Skip to content

Instantly share code, notes, and snippets.

View anandology's full-sized avatar

Anand Chitipothu anandology

View GitHub Profile
anandology / music.ipynb
Created July 11, 2023 14:01
Joy of Music
View music.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
anandology /
Created March 6, 2023 04:13
Utility to query database in python
"""The database interface.
Please see schema.sql for the schema of the tables.
from pathlib import Path
import sqlite3
import sys
from . import config
def query(q, parameters=[]):
anandology / main.aum
Created February 1, 2023 06:56
Austral Modules example.
View main.aum
import Square (square);
module body Main is
function main(): ExitCode is
let n: Int32 := 5;
let n2:Int32 := square(n);
return ExitSuccess();
anandology /
Created January 5, 2023 06:50
from kutty import Page, Table, Code, html
from _demo import Demo
page = Page("Bootstrap")
page << html.p("""
bootstrap experiments.
anandology /
Created November 1, 2022 17:01
The reduction game of @dabeaz
from functools import reduce
LEN = lambda items: reduce(lambda n, _: n + 1, items, 0)
REVERSE = lambda items: reduce(lambda rev, item: [item, *rev], items, [])
MAP = lambda func, items: reduce(lambda result, item: [*result, func(item)], items, [])
FILTER = lambda func, items: reduce(lambda result, item: [*result, item] if func(item) else result, items, [])
APPEND = lambda items, value: reduce(lambda result, item: [*result, item], [value], items)
anandology / schema.sql
Created September 15, 2022 12:01
Database schema for Rajdhani Challenge
View schema.sql
create table station (
code text primary key,
name text,
zone text,
state text,
address text,
latitude real,
longitude real
anandology /
Created June 30, 2022 17:51
Origami: the programming language of paper

The resource for this talk will be updated here soon.

anandology /
Last active June 9, 2021 10:30
API optioons for Joy
anandology /
Created May 24, 2021 03:42
email test using py.test
def test_sendmail(monkeypatch):
emails = []
def mock_sendmail(self, from_addr, to_addrs, msg, mail_options=(), rcpt_options=()):
emails.append(dict(from_addr=from_addr, to_addrs=to_addrs, msg=msg))
monkeypatch.setattr(smtplib.SMTP, "sendmail", mock_sendmail)
anandology /
Created May 20, 2021 07:28
Minimal test to reproduce issue with new frappe build system

This gist demonstrates one of the issues with the new build system of Frappe.

How to reproduce

Step 1

Add the sq.js and square.bundle.js from gist to apps/frappe/frappe/public/js in your bench.

Step 2