Skip to content

Instantly share code, notes, and snippets.

import os
import subprocess
import json
# %%
subprocess.run(
[
"wget",
@rgreenblatt
rgreenblatt / chess_fraction.py
Created December 17, 2023 01:21
Fraction chess
# %%
import os
import openai
import numpy as np
from tqdm import trange
# %%
@rgreenblatt
rgreenblatt / example_map.vim
Created April 20, 2021 16:28
Composable window maps for vim
let g:window_key_prefix = "<space>"
" the first value is the key and the second is the new window command
let g:window_key_mappings = [
\ ["h", "aboveleft vsplit"],
\ ["j", "belowright split"],
\ ["k", "aboveleft split"],
\ ["l", "belowright vsplit"],
\ [",",
\ "let buf = bufnr('%') <bar> tabnew <bar> execute 'buffer' buf"],
\ [".", ""],
@rgreenblatt
rgreenblatt / debug.zig
Created February 6, 2021 02:15
Won't work without some changes.
const builtin = @import("builtin");
const std = @import("std");
const assert = std.debug.assert;
const log = std.log.scoped(.debug);
const build_options = @import("build_options");
const log_writer = @import("log.zig").Writer{.context = {}};
const c = @import("c.zig");
extern var __debug_info_start: u8;
extern var __debug_info_end: u8;
@rgreenblatt
rgreenblatt / padam.py
Last active January 15, 2019 01:34
PadamW
from keras import backend as K
from keras.optimizers import Optimizer
from keras.utils import get_custom_objects
class Padam(Optimizer):
"""Partially adaptive momentum estimation optimizer.
# Arguments
lr: float >= 0. Learning rate.
beta_1: float, 0 < beta < 1. Generally close to 1.