This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
# Determine the maximum number of layers of nesting an integer or list has. | |
# That is, the maximum number of lists any particular integer is directly or | |
# indirectly inside. 1 is depth 0, [1] is depth 1, [[1]] is depth 2, etc. | |
def compute_depth(x): | |
if isinstance(x, int): return 0 | |
assert isinstance(x, list) | |
if not x: return 1 | |
return 1 + max(map(compute_depth, x)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\ProvidesClass{cvxx}[2021/10/05 betaveros's CV class] | |
\NeedsTeXFormat{LaTeX2e} | |
% Distantly based on https://www.latextemplates.com/template/friggeri-resume-cv (?) | |
% Requires the FontAwesome font and LaTeX package (among others) | |
\DeclareOption{print}{\def\@cv@print{}} | |
\DeclareOption{public}{\def\@cv@public{}} | |
\DeclareOption*{% | |
\PassOptionsToClass{\CurrentOption}{article}% | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name pancakescon timezone converter | |
// @version 1 | |
// @namespace https://beta.vero.site/ | |
// @include https://pancakescon.com/attend/ | |
// @grant none | |
// @description poorly translate the times to your local time zone on pancakescon.com | |
// ==/UserScript== | |
function signed(n) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import jinja2 | |
from lektor.pluginsystem import Plugin | |
from lektor.admin.webui import LektorInfo | |
from lektor.context import url_to | |
class ExtensionlessPlugin(Plugin): | |
name = 'extensionless' | |
description = u'Monkey patch the Jinja environment to strip .html from URLs and the server to add .html to extensionless URLs' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
from django.contrib.auth.models import AbstractUser | |
from django.db.models import OuterRef, Exists, Sum, Q | |
from django.core.validators import MinValueValidator | |
import django.urls as urls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <set> | |
#include <algorithm> | |
using namespace std; | |
#define fori(i,s,e) for(int i = s; i < ((int)e); i++) | |
#define allof(s) (s).begin(), (s).end() | |
const int MAX = 3000; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <set> | |
#include <algorithm> | |
#include <cstdlib> | |
using namespace std; | |
#define fori(i,s,e) for(int i = s; i < ((int)e); i++) | |
#define allof(s) (s).begin(), (s).end() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cassert> | |
#include <iostream> | |
#include <vector> | |
using namespace std; | |
#define fori(i,s,e) for(int i = s; i < ((int)e); i++) | |
long long gcd(long long x, long long y) { | |
return y == 0 ? x : gcd(y, x % y); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In [73]: for i in range(70): | |
...: print('C{} ='.format(i), end=" ") | |
...: try: | |
...: print(' '.join(pitch.nameWithOctave for pitch in ChordSymbol('C{}'.format(i)).pitches)) | |
...: except Exception as e: | |
...: print(e) | |
...: | |
C0 = C3 | |
C1 = C3 C3 | |
C2 = C3 D3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
major 40173 | |
dominant 19633 | |
minor 11501 | |
minor-seventh 7156 | |
major-seventh 2828 | |
maj 1516 | |
major-sixth 1442 | |
dominant-ninth 1210 | |
[] 1180 | |
minor-sixth 692 |
NewerOlder