Skip to content

Instantly share code, notes, and snippets.

View kipply's full-sized avatar
💜
Help the OOMKiller is after me

kipply kipply

💜
Help the OOMKiller is after me
View GitHub Profile
@kipply
kipply / embed-data
Last active December 21, 2021 17:53
This file has been truncated, but you can view the full file.
vowels, eyeiayiieoyuoeaoiuaieyieoyooyoeiaooueiiaiaoeiyeyaooyuyuiyauouyoauoiyeaueyaoyyeyioiiayyiauoaayoeeooeo
vowels, oeoeieaaoioeyeiiueeayeoiyoaueouiiioaoaiyyueyuioaiyuuyiuuoyauyuyyuyyoaeuiyiuyyaiyaaeeoeoiuyuoiiyeuuya
vowels, eooyuieiaeoeyiuouuoaeoieyiiuauoauaoauoiuoyayyiuyaiuoiaaiooeeayayauyieuayuyyauyieyeaeaauieyueouiauyua
numbers, 1260854290277092442320217756966980913070154896598969631678079933808433741913861613330078349140573862
consonants, skvhqjhkxrtlmmzrhmvjcgtrbfsfwtysbmqnlldlsyjqhhpkjglscrptgzjblgvcsgkrxnbkdlrlrqjtchbqjvzhfvyvmhpxflth
consonants, lxszwgvbygfnvkfwpssvhrphfppgnfymxwtktfkjdjfwlgpfdpftvrsdtdnycshflshrptqtjpxtdjsfvvdmjvsndzndynynlklb
vowels, uyeeoiaoooeyuoueieeeeauayoaoayaouyoieoeoueuiooouooyyaayiuuyoaeaeiyeiiuuoyaoeoaeyeoeaeeiaeauuuoaiiaie
consonants, ytghpvwkvwrtnzsdwxrtxqqvwsnhbsjjtkcssxrysvzhlrzpmxmfzsjckwywtrxhycgpkzyntxyvtptjhxddnwbtjxgqpbbmtsfh
vowels, yaoeeuueaauyoaiouiayeioeyyououauoayuiooiuioioiioeoooiyoyaoayoyoaeeaoeaaiooooaeeyeeuooiouaaoieeiiuoee
consonants, fhdtmzgcwpyvbrfsbq
This file has been truncated, but you can view the full file.
January 2005
(I wrote this talk for a high school. I never actually gave it, because the school authorities vetoed the plan to invite me.)
When I said I was speaking at a high school, my friends were curious. What will you say to high school students? So I asked them, what do you wish someone had told you in high school? Their answers were remarkably similar. So I'm going to tell you what we all wish someone had told us.
I'll start by telling you something you don't have to know in high school: what you want to do with your life. People are always asking you this, so you think you're supposed to have an answer. But adults ask this mainly as a conversation starter. They want to know what sort of person you are, and this question is just to get you talking. They ask it the way you might poke a hermit crab in a tide pool, to see what it does.
If I were back in high school and someone asked about my plans, I'd say that my first priority was to learn what the options were. You don't need to be in a rush to cho
@kipply
kipply / data.txt
Created August 9, 2021 18:20
random data
This file has been truncated, but you can view the full file.
/**********************************************************************
parse.y -
$Author$
created at: Fri May 28 18:02:42 JST 1993
Copyright (C) 1993-2007 Yukihiro Matsumoto
**********************************************************************/
The Cohere API is centered around *models*.
Each model has a different amount of power (i.e. parameters), to be used for different tasks.
Cohere has five baseline models: `shrimp`, `otter`, `seal`, `shark`, and `orca`.
Cohere also supports finetuning of baseline models to improve performance on downstream tasks or to teach the model large quantities of information which cannot be extracted with few-shot learning or prompt engineering.
SDKs

title = "Escape! From the Allocations: Escape Analysis in Pypy, LuaJIT, V8, C++, Go and More!" date = 2020-07-04

+++

With software engineering, speed and memory are the basic measurement-benchmarkes. For programming language implementations, the two affect each other heavily. In JIT compilers, that means storing more things in memory to speed up the program drastically. It also means putting time into garbage collection to keep memory down, spending time to try to eliminate allocations and deciding where to put some piece of data.

Escape Analysis is a technique that determines the behaviour of how a variable (more specifically, a pointer) is used in a certain scope, and whether it not it escapes that scope (the scope is usually a function). Escape analysis allows the program to stack allocate (here is an article on Stack vs Heap allocations) when it's determined the variable will not be used outside of the scope

@kipply
kipply / roam-theme-tester.txt
Last active June 7, 2020 02:47
Roam theme tester!
- [CSS Sheet Here!](https://raw.githubusercontent.com/kipply/roam-hug-theme/master/theme.css)
- I recommend installing with [Stylus](https://github.com/openstyles/stylus) or [Roam Toolkit](https://github.com/roam-unofficial/roam-toolkit) instead of [[roam/css]] to get #taoofroam loading page in dark mode too
- Other things to do:
- Right click a bullet
- Go to a block-page by clicking a bullet
- Try top bar buttons and search
- Check `all pages`
- try some searches and filtering
- [[test]]
- {{TaoOfRoam}}
@kipply
kipply / theme.css
Last active May 31, 2020 22:26
Roam Dark Theme CSS
@media (prefers-color-scheme: dark) {
.roam-body .roam-app .roam-sidebar-container .roam-sidebar-content .log-button {
padding: 8px 20px;
cursor: pointer;
font-size: 16px;
color: #8be9fd;
}
/* Background color for the rest of body */
@kipply
kipply / io_template.zig
Last active July 24, 2020 03:19
Zig Sample I/O
const std = @import("std");
const stdin = std.io.getStdIn().inStream();
const stdout = std.io.getStdOut().outStream();
// Avoid alloc
var line_buf: [1024]u8 = undefined;
var int_buf: [1024]i64 = undefined;
var tokens_buf: [1024][]const u8 = undefined;
pub fn main() !void {
@kipply
kipply / profile.rb
Last active September 17, 2022 08:41
Ruby Code ||= Lazy Initialization Profiling
# When run on the following 20 repositories, it found 2082 ||= and it was used as lazy init 64.3% of the time
# Those numbers are fuzzy, as there is not certain way to prove if something was used as a lazy init
# This script only marks a usage as a lazy init if the variable is being set to a constant,
# in which case if it is not a lazy init then the developers have done something weird.
# It is also marked as a lazy init if the variable is an instance variable or a class variable (either @var or @@var)
# AND the lazy init is used in the top level of a function, AND the function name is contained by the variable or vice versa.
# These are almost certain to be lazy initialized because the assumed behaviour is to always call the method instead of the variable,
# and other usages would be both weird usage of instance/class variables and/or weird usage of the method naming
# This of course, misses a variety of cases but likely does not get any cases that do not lazy initialize.
# A better way to profile could be
@kipply
kipply / derive.js
Created November 27, 2019 05:24
Recurse thingy
var equation = "3x^4+2x**3-2.4x^2 + 9x - 3.1 ";
equation = equation.replace("**", "^");
equation = equation.replace(/\s/g, "");
terms = equation.match(/([-\+]|^)[0-9.]+(x(\^[0-9]+)?)?/g);
derivative = "";
terms.forEach(term => {
let coefficient = term.match(/(-|\+|^)[0-9.]+/g);