Skip to content

Instantly share code, notes, and snippets.

// This is Twigl's "geekest mode" so the code runs inside a "main" function.
// FC.xy is fragcoord
// r.xy is resolution
// t is time (in seconds I think)
// o.rgba is output color
// This is the original code, before any readability improvements:
/*
#define X(S,D)I=ivec3(S);D=fract(float(I.x^I.y^I.z)*PI
@xAiluros
xAiluros / autotile-rpgm-to-tiled.py
Last active October 31, 2022 03:52
rpgmaker autotiles to Tiled
#!/usr/bin/env python3
#
# Script to convert autotile from rpgmaker form to Tiled.
# Based on post: https://forums.rpgmakerweb.com/index.php?threads/auto-tiles-in-tiled-parallax-mapping-made-easier.97739/
#
from PIL import Image
import sys
@vickyqian
vickyqian / twitter crawler.txt
Last active May 11, 2024 16:19
A Python script to download all the tweets of a hashtag into a csv
import tweepy
import csv
import pandas as pd
####input your credentials here
consumer_key = ''
consumer_secret = ''
access_token = ''
access_token_secret = ''
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
@jmpinit
jmpinit / frag.glsl
Created August 8, 2015 18:20
GLSL Bayer dithering shader.
// adapted from http://devlog-martinsh.blogspot.com/2011/03/glsl-8x8-bayer-matrix-dithering.html
uniform sampler2D bgl_RenderedTexture;
uniform sampler2D bayerTexture;
varying vec2 vUv;
float find_closest(float x, float y, float c0) {
float limit = texture2D(bayerTexture, vec2(x / 4.0, y / 4.0)).r;
@Youka
Youka / lua_myobject.cpp
Last active May 16, 2024 19:59
Example of Lua in C++ and userdata objects
// Lua C API
#include <lua.hpp>
// C++ input/output streams
#include <iostream>
// MyObject as C++ class
class MyObject{
private:
double x;
public:
# Filename : Image2Map.py
# Authors : Georg Muntingh and Bjorn Lindeijer
# Version : 1.2
# Date : June 16, 2010
# Copyright : Public Domain
import os, sys, Image, networkx
class TileMap:
""" This class represents a map of tiles.
@coderofsalvation
coderofsalvation / winetalk
Created July 5, 2012 11:52
winetalk - named pipes for communication between wine and linux bash
# setup named pipes for wine<->linux shell communication
#
# APPLICATIONS: glue linux & wine, use linux in .bat scripts, system() C-calls etc
# USAGE:
#
# [linux]
# mkfifo /tmp/wine_in
# mkfifo /tmp/wine_out
# ./winetalk /tmp/wine_in /tmp/wine_out
#