Skip to content

Instantly share code, notes, and snippets.

@ityonemo
ityonemo / test.md
Last active September 18, 2026 19:35
Zig in 30 minutes

A half-hour to learn Zig

This is inspired by https://fasterthanli.me/blog/2020/a-half-hour-to-learn-rust/

Basics

the command zig run my_code.zig will compile and immediately run your Zig program. Each of these cells contains a zig program that you can try to run (some of them contain compile-time errors that you can comment out to play with)

@vsoch
vsoch / decorators.py
Created December 3, 2020 20:01
An example for how to customize login-required (in this case, to use a session based token instead)
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.shortcuts import render, resolve_url
from myapp.settings import cfg
from myapp import settings
from urllib.parse import urlparse
import uuid
def login_is_required(
@gullyn
gullyn / flappy.html
Last active November 19, 2025 15:40
Flappy bird in 205 bytes (improved!)
<body onload=z=c.getContext`2d`,setInterval(`c.width=W=150,Y<W&&P<Y&Y<P+E|9<p?z.fillText(S++${Y=`,9,9|z.fillRect(p`}*0,Y-=--M${Y+Y},P+E,9,W),P))):p=M=Y=S=6,p=p-6||(P=S%E,W)`,E=49) onclick=M=9><canvas id=c>
@mob-sakai
mob-sakai / _README.md
Last active April 5, 2026 15:44
Run shell script on gist

Run shell script on gist

Shells that support process substitution such as bash and zsh allow to run shell script on gist as follows.

# With curl:
bash <(curl -sL ${GIST_URL}) args...

# With wget:
@senderle
senderle / hand-modify-pdf.md
Created September 23, 2020 15:03
So you want to modify the text of a PDF by hand

So you want to modify the text of a PDF by hand...

If you, like me, resent every dollar spent on commercial PDF tools, you might want to know how to change the text content of a PDF without having to pay for Adobe Acrobat or another PDF tool. I didn't see an obvious open-source tool that lets you dig into PDF internals, but I did discover a few useful facts about how PDFs are structured that I think may prove useful to others (or myself) in the future. They are recorded here. They are surely not universally applicable --
the PDF standard is truly Byzantine -- but they worked for my case.

@hyrious
hyrious / tio.rb
Created May 27, 2020 08:34
tio.run api
# coding: utf-8
module Tio
def self.languages
require 'json'
JSON.load(Net::HTTP.get(URI('https://tio.run/languages.json'))).keys
end
def self.run_url
URI('https://tio.run/cgi-bin/run/api/')
@deebs67
deebs67 / ARMlite.md
Last active January 17, 2026 21:26
ARMlite simulator

ARMlite simulator

The ARMlite simulator is a web-based simulator of a 32-bit 'ARM-like' processor and Instruction Set Architecture (ISA), developed by Peter Higginson and Richard Pawson for teaching Computer Science (CS) principles and Assembly Language. It is targetted particularly towards the AQA A-level computing syllabus. It is exceptionally user-friendly and fast, and great fun to experiment with!

Free online student textbook on the topic:
[1] Richard Pawson (with Peter Higginson), Computer Science from the Metal Up - Assembly Language Programming, v1.0.0, 2020
https://peterhigginson.co.uk/ARMlite/Assembly%20Language%20-%20Student%20version.pdf

Online simulator for the ARMlite ISA here:
https://www.peterhigginson.co.uk/ARMlite/

@Tynael
Tynael / README.md
Last active February 18, 2026 00:49
How to use npx to run gist based scripts
@skeeto
skeeto / mazelog-2016-09.c
Last active November 8, 2021 15:00
Mazelog Monthly Challenge Solvers
#include <stdio.h>
static char game[8][8] = {
"nbrnnnnr",
"rbnn n n",
"bnnnrbb ",
"rnrkknnb",
"rbrkk n ",
"bnn r n",
"nnnnn bn",
const express = require('express');
const htm = require('htm');
const vhtml = require('vhtml');
// create an html`` tag function for vhtml:
const html = htm.bind(vhtml);
const App = (props) => html`
<div class="app">
<h1>This is an app</h1>