Skip to content

Instantly share code, notes, and snippets.

View stagfoo's full-sized avatar
🎨
Do I Dream of Electric Bugs

Alex King stagfoo

🎨
Do I Dream of Electric Bugs
View GitHub Profile
@redthing1
redthing1 / README.md
Last active March 11, 2024 08:01
convert xresources colors to kitty

xres to kitty

a quick converter to convert Xresources format color definitions (from terminal.sexy) to Kitty's color configuration format.

usage: ./xres_to_kitty.py < xres_colors.txt >> ~/.config/kitty/kitty.conf

ideally, you would clear the existing previously generated colors from the kitty conf file before running.

@SIsilicon
SIsilicon / Painting postprocess.shader
Last active August 19, 2021 17:40
Godot Painting Post procssing effect
shader_type canvas_item;
uniform sampler2D distort_texture;
uniform float fade : hint_range(0.0, 1.0) = 0.86;
uniform float desat : hint_range(0.0, 1.0) = 0.3;
uniform float scale = 0.009;
uniform float intensity = 0.041;
uniform int kuwahara_radius = 4;
@mindplay-dk
mindplay-dk / image-url.ts
Last active September 28, 2023 15:25
Rotate image preview to compensate for EXIF orientation (Javascript / Typescript)
// Based on: https://stackoverflow.com/a/46814952/283851
/**
* Create a Base64 Image URL, with rotation applied to compensate for EXIF orientation, if needed.
*
* Optionally resize to a smaller maximum width - to improve performance for larger image thumbnails.
*/
export async function getImageUrl(file: File, maxWidth: number|undefined) {
return readOrientation(file).then(orientation => applyRotation(file, orientation || 1, maxWidth || 999999));
}
@nikhita
nikhita / install-firacode.sh
Created April 24, 2017 17:32
How to install FiraCode font on Linux
mkdir -p ~/.local/share/fonts
for type in Bold Light Medium Regular Retina; do wget -O ~/.local/share/fonts/FiraCode-$type.ttf "https://github.com/tonsky/FiraCode/blob/master/distr/ttf/FiraCode-$type.ttf?raw=true"; done
fc-cache -f
@monolithed
monolithed / file.js
Created April 24, 2017 07:28 — forked from alexcorvi/file.js
JSX without react
var React = {
createElement: function (tag, attrs, children) {
var e = document.createElement(tag);
// Add attributes
for (var name in attrs) {
if (name && attrs.hasOwnProperty(name)) {
var v = attrs[name];
if (v === true) {
e.setAttribute(name, name);
@aishikaty
aishikaty / tiny-view-libraries.md
Last active June 23, 2024 13:28
Tiny JavaScript UI

☀️ UI Libraries

  • redom (1.6k) - Tiny turboboosted JavaScript library for creating user interfaces
  • frzr (1.6k) - Turboboosted 2 KB view library for browser & node.js
  • killroy (1.9k) - A tiny ui library inspired by React
  • real-dom (0.7k) - A ~1K non-virtual DOM non-framework framework for simple apps
  • domchanger (1.8k) - Dombuilder that applies diffs only to the real dom
  • vomit (3.2k) - A high order function using virtual dom to build user interfaces
  • bel (3.5k) - A simple library for composable DOM elements using tagged template strings
  • yo-yo (5.4k) - A tiny library for building modular UI components using DOM diffing and ES6 tagged template literals (build on bel)
  • [choo](https://github.com/yos
@crtr0
crtr0 / client.js
Created June 8, 2012 17:02
A simple example of setting-up dynamic "rooms" for socket.io clients to join
// set-up a connection between the client and the server
var socket = io.connect();
// let's assume that the client page, once rendered, knows what room it wants to join
var room = "abc123";
socket.on('connect', function() {
// Connected, let's sign-up for to receive messages for this room
socket.emit('room', room);
});