Skip to content

Instantly share code, notes, and snippets.

@liquidev
liquidev / class.md
Last active February 8, 2025 21:44
My attempt at explaining how to implement classes in Lua

NOTE (2025-02-08)

I've since moved the tutorial over to my website. Clarified some of the wording, added exercises at the end, added links to useful resources.

For historical reasons, I'm keeping the original text here. But if you've just stumbled upon this tutorial for the first time, you may want to check out the revised version!

https://riki.house/programming/lua/classes


@nilsmagnus
nilsmagnus / sign_and_verify_test.go
Last active October 10, 2022 16:38
Sign a message and verify signature with go using PKCS1. Compatible with java (SHA256withRSA)
package main
import (
"crypto"
"crypto/rand"
"crypto/rsa"
"crypto/sha256"
"encoding/base64"
"testing"
)
@kottenator
kottenator / simple-pagination.js
Created July 13, 2015 20:44
Simple pagination algorithm
// Implementation in ES6
function pagination(c, m) {
var current = c,
last = m,
delta = 2,
left = current - delta,
right = current + delta + 1,
range = [],
rangeWithDots = [],
l;
@jaysonrowe
jaysonrowe / .muttrc
Created May 6, 2012 23:10
Mutt Configuration
# basic .muttrc for use with Gmail
# Change the following six lines to match your Gmail account details
set imap_user = "[email protected]"
set imap_pass = ""
set smtp_url = "smtp://[email protected]:587/"
set smtp_pass = ""
set from = "[email protected]"
set realname = "Firstname Lastname"
#
@tuupola
tuupola / gist:870771
Created March 15, 2011 14:20
jQuery tools calendar translation for Estonian, Russian, Latvian and Lithuanian.
var estonian = {
months: "Jaanuar,Veebruar,Märts,Aprill,Mai,Juuni,Juuli,August,September,Oktoober,November,Detsember",
shortMonths: "jaan.,veebr.,märts,apr.,mai,juuni,juuli,aug.,sept.,okt.,nov.,dets.",
days: "Pühapäev,Esmaspäev,Teisipäev,Kolmapäev,Neljapäev,Reede,Laupäev",
shortDays: "P,E,T,K,N,R,L"
};
var russian = {
months: "Январь,Февраль,Март,Апрель,Май,Июнь,Июль,Август,Сентябрь,Октябрь,Ноябрь,Декабрь",
shortMonths: "янв,фев,мар,апр,май,июн,июл,авг,сен,окт,ноя,дек",