Skip to content

Instantly share code, notes, and snippets.

@markknol
markknol / shadertoy.md
Last active April 29, 2024 12:41
Shader cheatsheet (from shadertoy)

This help only covers the parts of GLSL ES that are relevant for Shadertoy. For the complete specification please have a look at GLSL ES specification

Language:

Version: WebGL 2.0
Arithmetic: ( ) + - ! * / %
Logical/Relatonal: ~ < > <= >= == != && ||
Bit Operators: & ^ | << >>
Comments: // /* */
Types: void bool int uint float vec2 vec3 vec4 bvec2 bvec3 bvec4 ivec2 ivec3 ivec4 uvec2 uvec3 uvec4 mat2 mat3 mat4 mat?x? sampler2D, sampler3D samplerCube
Format: float a = 1.0; int b = 1; uint i = 1U; int i = 0x1;

@emxsys
emxsys / raspberry_pi_script_as_service.md
Last active April 6, 2024 13:46
How to run a python script as a service in Raspberry Pi - Raspbian Jessie

How to Run a Script as a Service in Raspberry Pi - Raspbian Jessie

By: Diego Acuña

Original Article: http://www.diegoacuna.me/how-to-run-a-script-as-a-service-in-raspberry-pi-raspbian-jessie/

A pretty common task when using this device, is to run some script (for example a python script) as a service in the operating system so it can start on boot, stop and restart using systemctl and more. In this post I'm going to explain how to set a little script as a service using Raspbian Jessie in a Raspberry Pi.

Example Python Script

@magicznyleszek
magicznyleszek / multiply-blending-mode-to-png.md
Created August 20, 2014 11:27
Multiply blending mode to PNG in Photoshop
  1. copy your image (Ctrl+A and Ctrl+C)
  2. make a new document-sized pure-black layer behind it
  3. group the black layer and yor image together
  4. add mask to the group
  5. enter mask edit mode (alt+click on the mask icon/thumbnail)
  6. paste your image in the mask (b/w) and then invert it.
  7. save it as a 24-bit transparent PNG
@Beeblerox
Beeblerox / CRTFilter
Created July 23, 2017 09:34
CRTFilter for OpenFl 5.0
package;
import openfl.Lib;
import openfl.display.Shader;
import openfl.filters.BitmapFilter;
import openfl._internal.renderer.RenderSession;
import openfl.geom.Point;
/**
* ...
@jcward
jcward / Readme.txt
Created April 14, 2017 15:08
Generating iOS P12 / certs without Mac OSX Keychain (on linux, windows, etc)
1) Generate a private key and certificate signing request:
openssl genrsa -out ios_distribution.key 2048
openssl req -new -key ios_distribution.key -out ios_distribution.csr -subj '/emailAddress=me@example.com, CN=Example, C=US'
2) Upload CSR to apple at: https://developer.apple.com/account/ios/certificate/create
- choose Production -> App Store and Ad Hoc
3) Download the resulting ios_distribution.cer, and convert it to .pem format:
@gepatto
gepatto / install_haxe_from_docker.sh
Last active March 4, 2023 19:52
DEPRECATED: install haxe from docker and copy to system (needs docker installed). Run as ./install_haxe_from_docker.sh 4.1.5-buster
#!/bin/bash
#DEPRECATED
BLACK="[30m"
RED="[31m"
GREEN="[32m"
YELLOW="[33m"
BLUE="[34m"
PURPLE="[35m"
@thikade
thikade / mcp.desktop
Last active December 10, 2022 16:19
control minecraft-pi using xbox controller on raspberry pi
[Desktop Entry]
Name=Minecraft Pi MCP
Comment=Fun with Blocks
# TryExec=minecraft-pi
Exec=/home/pi/mcp.sh
Icon=/usr/share/pixmaps/minecraft-pi.png
Terminal=false
Type=Application
Categories=Application;Game;
StartupNotify=true
@elsassph
elsassph / ResourceGenerator.hx
Created July 3, 2016 13:21
Haxe build macro converting a JSON file into strongly typed, inline/dce friendly, properties
package;
#if macro
import haxe.Json;
import haxe.macro.Context;
import haxe.macro.Expr;
import haxe.macro.Type;
import sys.io.File;
import sys.FileSystem;
@player-03
player-03 / Tiles in View
Last active June 23, 2021 05:43
A demo of how to scroll tiles without creating a new array every frame.
package;
import openfl.Assets;
import openfl.Lib;
import openfl.display.Shape;
import openfl.display.Sprite;
import openfl.display.Tile;
import openfl.display.Tilemap;
import openfl.display.Tileset;
import openfl.events.Event;
@sambler
sambler / multi_scene_setup.py
Last active June 7, 2021 07:47
Setup multi scene rendering
# made in answer to http://blender.stackexchange.com/q/74086/935
import bpy
master_render_scene_name = 'Multi_render'
base_path = '//renders/'
if master_render_scene_name not in bpy.data.scenes:
bpy.data.scenes.new(name=master_render_scene_name)