Skip to content

Instantly share code, notes, and snippets.

View dknight's full-sized avatar

Dmitri Smirnov dknight

View GitHub Profile
@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: "янв,фев,мар,апр,май,июн,июл,авг,сен,окт,ноя,дек",
@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 = "username@gmail.com"
set imap_pass = ""
set smtp_url = "smtp://username@smtp.gmail.com:587/"
set smtp_pass = ""
set from = "username@gmail.com"
set realname = "Firstname Lastname"
#
@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;
@liquidev
liquidev / class.md
Last active April 30, 2024 16:24
My attempt at explaining how to implement classes in Lua

If you're reading this document, you're probably one of many people confused about how to implement OOP-like classes in Lua. But no worries! This document aims to explain all the fundamental concepts in beginner-friendly language.

Metatables

Before we start, we need to talk about metatables. These are Lua's way of allowing users to overload operators. Operators include arithmetic +, -, *, /, etc., but also things like indexing tables a[b], creating new indices in tables a[b] = c, function calls, a(b, c, d), you get the idea.

We can set the metatable of a table using setmetatable(t, metatable). The metatable is another table, that contains fields for overriding