Skip to content

Instantly share code, notes, and snippets.

@1bardesign
1bardesign / typewriter_demo.lua
Created October 5, 2018 07:03
a simple line by line "typewriter" text demo for love2d
--[[
typewriter class
]]
local typewriter = {}
--(metatable used for instances, don't worry about it too much
-- but do read up on metatables at some point)
typewriter._mt = {__index = typewriter}
--create a new typewriter
@cryzed
cryzed / fix-infinality.md
Last active January 19, 2024 08:56
A set of instructions on how to fix the harfbuzz + Infinality issue and restoring good-looking, Infinality-like font rendering.

Disclaimer: Please follow this guide being aware of the fact that I'm not an expert regarding the things outlined below, however I made my best attempt. A few people in IRC confirmed it worked for them and the results looked acceptable.

Attention: After following all the steps run gdk-pixbuf-query-loaders --update-cache as root, this prevents various gdk-related bugs that have been reported in the last few hours. Symptoms are varied, and for Cinnamon the DE fails to start entirely while for XFCE the icon theme seemingly can't be changed anymore etc.

Check the gist's comments for any further tips and instructions, especially if you are running into problems!

Screenshots

Results after following the guide as of 11.01.2017 13:08:

@kikito
kikito / grid.lua
Created May 29, 2014 12:48
Grid traversal
local grid = {}
local function grid_toCell(cellSize, x, y)
return math.floor(x / cellSize) + 1, math.floor(y / cellSize) + 1
end
-- grid_traverse* functions are based on "A Fast Voxel Traversal Algorithm for Ray Tracing",
-- by John Amanides and Andrew Woo - http://www.cse.yorku.ca/~amana/research/grid.pdf
-- It has been modified to include both cells when the ray "touches a grid corner",
-- and with a different exit condition
@mdwhatcott
mdwhatcott / s3_presign.py
Last active April 19, 2021 14:02
Generate a pre-signed S3 URL (valid for 20 years) with nothing but the standard library.
#!/usr/bin/env python
"""
Generates a pre-signed S3 URL using a valid key pair that lasts for 20 years.
Reference: http://forrst.com/posts/Python_method_for_creating_authenticated_s3_URLs-uUM
"""
import base64, hmac, os, sha, sys, time, urllib
@tylerneylon
tylerneylon / learn.lua
Last active April 2, 2024 15:09
Learn Lua quickly with this short yet comprehensive and friendly script. It's written as both an introduction and a quick reference. It's also a valid Lua script so you can verify that the code does what it says, and learn more by modifying and running this script in your Lua interpreter.
-- Two dashes start a one-line comment.
--[[
Adding two ['s and ]'s makes it a
multi-line comment.
--]]
----------------------------------------------------
-- 1. Variables and flow control.
----------------------------------------------------
@olidb2
olidb2 / sst2json.sh
Created April 23, 2012 21:05
sst2json oli script
#!/bin/sh
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0