Skip to content

Instantly share code, notes, and snippets.

set -g default-terminal "tmux-256color"
set -g mouse on
set -g focus-events on
set -g status-position top
set -g prefix C-a
setw -g mode-keys vi
set -sg escape-time 0
set -sa terminal-features ',xterm-kitty:RGB'
#!/usr/bin/env python3
def eval(instructions: list):
stack = []
mem = {}
exec = list(reversed(instructions))
binary_ops = {
"add": lambda v1, v2: v1 + v2,
"sub": lambda v1, v2: v1 - v2,
@jpschroeder
jpschroeder / nunit-scripts.csx
Created June 15, 2020 13:49
Minimal NUnit With dotnet-script
#r "nuget: NUnit, 3.12.0"
#r "nuget: NUnitLite, 3.12.0"
using NUnit.Framework;
using NUnitLite;
public class MyTests
{
[Test]
public void PassingTest()
=> Assert.IsTrue(true);
@jpschroeder
jpschroeder / service_broker_test.sql
Last active February 21, 2023 14:51
Streaming with SQL Server
--
-- setup
--
create database servicebrokertest
go
alter database servicebrokertest set enable_broker
go
use servicebrokertest
go
@jpschroeder
jpschroeder / Cgiserver.go
Last active January 8, 2023 02:05
CGI Demo with Go
package main
import (
"fmt"
"log"
"net/http"
"net/http/cgi"
)
// Render links to child pages
@jpschroeder
jpschroeder / closure.js
Last active November 23, 2015 04:10
Closures in Javascript
"use strict";
// A closure is a function that has one or more variables bound to it.
// In the following simple example, notice that the sayHi function accesses the greeting variable
// from outside of its scope. This is possible due to lexical scoping in javascript.
var greetingFactory = function() {
var greeting = 'Hello there'
var sayHi = function(name) {
return greeting + ' ' + name;