Skip to content

Instantly share code, notes, and snippets.

@perky
perky / ProFi.lua
Created May 30, 2012 20:32
ProFi, a simple lua profiler that works with LuaJIT and prints a pretty report file in columns.
--[[
ProFi v1.3, by Luke Perkin 2012. MIT Licence http://www.opensource.org/licenses/mit-license.php.
Example:
ProFi = require 'ProFi'
ProFi:start()
some_function()
another_function()
coroutine.resume( some_coroutine )
ProFi:stop()
@dpatti
dpatti / mechanics.md
Last active November 8, 2022 23:22
Binding of Isaac Mechanics Guide

Binding of Isaac Mechanics Guide

Stats

Health

Each character starts with the following health

  • Isaac: 3
  • Maggy: 4
  • Cain: 2
  • Judas: 1
@defp
defp / post.lua
Created August 20, 2013 20:19
use luasocket send post data
#!/usr/bin/env lua
local http=require("socket.http");
local request_body = [[login=user&password=123]]
local response_body = {}
local res, code, response_headers = http.request{
url = "http://httpbin.org/post",
method = "POST",
headers =
@staltz
staltz / introrx.md
Last active November 19, 2024 02:40
The introduction to Reactive Programming you've been missing
@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active November 18, 2024 07:45
GLSL Noise Algorithms

Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
@urraka
urraka / stb.c
Last active September 16, 2024 17:12
#define STB_IMAGE_IMPLEMENTATION
#define STB_IMAGE_WRITE_IMPLEMENTATION
#define STBI_ONLY_PNG
#define STBI_ONLY_JPEG
#define STBI_ONLY_BMP
#define STBI_ONLY_GIF
#include "stb_image.h"
#include "stb_image_write.h"
.app a {
color: #5294E2
}
.titlebar {
height: 5px
}
.guilds-wrapper {
background: #2a2f38
}
.guilds-wrapper .guilds .guild+.guild {
@josefnpat
josefnpat / Makefile
Last active July 5, 2020 08:19
Love Makefile of Doom
# Copyright 2017 Josef N Patoprsty
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
@jakebesworth
jakebesworth / main.lua
Last active November 1, 2023 19:50 — forked from Leandros/main.lua
Love2D 11.X Fix Your Timestep! "Free the physics" 4th approach
--[[
Original Author: https://github.com/Leandros
Updated Author: https://github.com/jakebesworth
MIT License
Copyright (c) 2018 Jake Besworth
Original Gist: https://gist.github.com/Leandros/98624b9b9d9d26df18c4
Love.run 11.X: https://love2d.org/wiki/love.run
Original Article, 4th algorithm: https://gafferongames.com/post/fix_your_timestep/
Forum Discussion: https://love2d.org/forums/viewtopic.php?f=3&t=85166&start=10
@msklywenn
msklywenn / fetch_steam_leaderboard.php
Last active December 15, 2020 09:50
Fetch & cache steam leaderboards to display on your website
<?php
// ref: https://partner.steamgames.com/doc/webapi/ISteamLeaderboards
$cache_filename = "leaderboard_cache";
$default_leaderboard = "Normal";
if (!file_exists($cache_filename) || time() - filemtime($cache_filename) > 3600)
{
$max = 10; // how many displayed scores
$key = ""; // steam webapi key, to get it: https://partner.steamgames.com/doc/webapi_overview/auth#create_publisher_key
$appid = ""; // your game's app id
// the names and corresponding leaderboard IDs