Skip to content

Instantly share code, notes, and snippets.

@akrolsmir
akrolsmir / deposit-manaz\route.ts
Created November 21, 2023 01:08
Working snippet of route.ts
import { getUser } from '@/db/profile'
import { createEdgeClient } from '@/pages/api/_db'
import { NextRequest, NextResponse } from 'next/server'
import uuid from 'react-uuid'
export const runtime = 'edge'
// Manifold user ID for hi@manifund.org
const MANAGRAM_DEST_ID = 'pyBueUg9y3hrDIUtrus5uAkPHCr1'
@akrolsmir
akrolsmir / harry-potter.txt
Last active April 3, 2021 23:34
Harry Potter words for One Word (courtesy of Harrison Tu)
Quidditch Gear,
Duel,
Slytherin,
Ravenclaw,
Hufflepuff,
Gryffindor,
Educational decree,
Wizard,
Witch,
Muggle,
<template>
<BigColumn>
<h1 class="fancy big mb-4">MetaPrompt</h1>
<div class="box prompt is-italic">
{{ promptCard.text }}
</div>
<textarea
class="textarea"
v-model="text"
placeholder="Respond here..."
osu file format v14
[General]
AudioFilename: audio.mp3
AudioLeadIn: 0
PreviewTime: 133610
Countdown: 0
SampleSet: Soft
StackLeniency: 0.7
Mode: 3
@akrolsmir
akrolsmir / DeltaParser.ts
Created September 2, 2020 19:59
DeltaParser.ts, without Immutable
/**
* @license
* Copyright 2018-2020 Streamlit Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
// Problem: Given a string "line" and a number "xCount", output all versions of the string
// with exactly xCount locations replaced by "X".
// e.g. "abcd", 2 => ["XXcd", "XbcX", "abXX", etc...]
// For each line in lines, replace the character at index with 'X'
function joinLine(index, lines) {
function blot(line) {
return (
line.substring(0, index - 1) + 'X' + line.substring(index, line.length)
);
@akrolsmir
akrolsmir / batoto_follows_to_mangadex.js
Last active January 24, 2018 06:16
Import your manga from Batoto to Mangadex
/*
Instructions:
1) Go to https://mangadex.com on Chrome.
2) Open the Chrome console (Ctrl+Shift+J on Windows).
3) Copy + paste the code in this file.
4) Replace batoto_ids in line 10 with a list of the manga to follow.
5) Hit Enter.
*/
var batoto_ids = [1, 2, 3, 5, 8] // TODO: REPLACE WITH YOUR OWN MANGA

PolyLines - 2D

Creating:

polyline = PolyLine([[0,0],[0,10],[10,0],[0,0]])
polyline = PolyLine(generator=solid_object_2D)

Checking:

polyline.show()
@akrolsmir
akrolsmir / recs.txt
Last active September 11, 2015 05:36
Anime Recs
Movies
Wolf Children Ame and Yuki (Ookami Kodomo Ame to Yuki) - Slice of life. A mother struggles to raise her half-wolf children. 2 hours.
Time of Eve (Eve no Jikan) - Sci-fi. A cafe where androids are free from discrimination. 2 hours.
Book Girl (Bungaku Shoujo) - Mystery. A girl who literally devours books, and the boy who writes her snacks. 2 hours.
Garden of Words (Kotonoha no Niwa) - Romance. Boy skipping school encounters woman skipping work. 45 min.
Shows
Spice and Wolf - Medieval fantasy, economics. Traveling merchant journeys with wolf goddess. 2 cour.
Steins;Gate - Sci-fi, mystery. College students time travel with microwaves and cell phones. 2 cour.
Hataraku Maou-sama - Fantasy, comedy. The Devil works part-time at MgRonald's. 1 cour.
{
"Name": "Austin Chen",
"Year": "Sophomore",
"Major": "EECS",
"Email": "chen.austin@berkeley.edu"
}