Skip to content

Instantly share code, notes, and snippets.

@0x1eef
0x1eef / f.rb
Last active July 14, 2025 10:14
An implementation of Python's formatted strings in pure Ruby
require "bundler/inline"
gemfile do
gem "binding_of_caller"
end
require "binding_of_caller"
module Kernel
def f(template, vars = binding.of_caller(1))
@0x1eef
0x1eef / ejs.ts
Created April 24, 2023 19:31
EJS vite plugin
import { PluginOption } from "vite";
import { render } from 'ejs';
import path from 'path';
import fs from 'fs';
type ReadFile = [string, object];
const readFile = async (...args: ReadFile) => {
const [path, options] = args;
return new Promise((resolve, reject) => {
fs.readFile(path, options, (err, data) => {