Skip to content

Instantly share code, notes, and snippets.

View runfalk's full-sized avatar
🙃
What's happening?

Andreas Runfalk runfalk

🙃
What's happening?
View GitHub Profile
@runfalk
runfalk / init.lua
Created June 29, 2021 20:06
Neovim 0.5 config
-- Setup plugins (remember trailing semi-colon)
-- (Use :PaqInstall or :PaqUpdate)
require "paq-nvim" {
-- Let Paq manage itself
"savq/paq-nvim";
-- LSP support
"neovim/nvim-lspconfig";
-- Auto complete
@runfalk
runfalk / range.js
Created June 8, 2017 15:49
Old interval implementation for JavaScript
function InvalidSetException(message) {
this.message = message
}
function DateRange(lower, upper) {
this.empty = false;
this.lower = lower;
this.upper = upper;
if (this.lower) {
this.lower = this.lower.clone();
import itertools
import os
import re
from lektor.db import F
from lektor.types import SelectType
from lektor.pluginsystem import Plugin
class AttachmentType(SelectType):
@runfalk
runfalk / jsonsession.py
Created April 26, 2012 18:52
JSON session cookie for Flask, instead of pickle
# Assumes app = Flask(...)
import json
from flask.sessions import SecureCookieSession, SecureCookieSessionInterface
class JSONSecureCookieSession(SecureCookieSession):
serialization_method = json
class JSONSecureCookieSessionInterface(SecureCookieSessionInterface):
session_class = JSONSecureCookieSession