Skip to content

Instantly share code, notes, and snippets.

@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;
@ldct
ldct / postgres.sh
Last active September 13, 2018 07:26
postgres 9.6 ubuntu 15.04
sudo apt-get install git build-essential curl xclip
sudo apt-get install bison flex libreadline-dev libz-dev
git clone git://git.postgresql.org/git/postgresql.git
cd postgresql; ./configure; make; sudo make install
cd contrib; make; sudo make install
sudo adduser postgres
sudo mkdir /usr/local/pgsql/data
sudo chown postgres -R /usr/local/pgsql/data
@rattrayalex
rattrayalex / app.coffee
Last active September 11, 2018 23:46
Demo
Bacon = require('baconjs')
Imm = require('immutable')
React = require('react')
window.Actions =
changeFirstName: new Bacon.Bus()
changeLastName: new Bacon.Bus()
changeCountry: new Bacon.Bus()
addCountryBird: new Bacon.Bus()
addFriend: new Bacon.Bus()
@KdotJPG
KdotJPG / OpenSimplex2S.java
Last active May 22, 2024 23:03
Visually isotropic coherent noise algorithm based on alternate constructions of the A* lattice.
/**
* K.jpg's OpenSimplex 2, smooth variant ("SuperSimplex")
*
* More language ports, as well as legacy 2014 OpenSimplex, can be found here:
* https://github.com/KdotJPG/OpenSimplex2
*/
public class OpenSimplex2S {
private static final long PRIME_X = 0x5205402B9270C86FL;
@staltz
staltz / introrx.md
Last active May 24, 2024 07:56
The introduction to Reactive Programming you've been missing
@Kartones
Kartones / postgres-cheatsheet.md
Last active May 24, 2024 09:21
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@roman01la
roman01la / monit
Created January 26, 2014 11:18
Node.js + Nginx + Varnish + Upstart + Monit
check host localhost with address 127.0.0.1
start "/sbin/start myapp"
stop "/sbin/stop myapp"
if failed port 3000 protocol HTTP
request /
with timeout 5 seconds
then restart
@Maksims
Maksims / vec2.js
Last active January 3, 2016 12:49
"rude" extension to Float32Array, implementing 2D Vector Math.
// degree to radians constant
var rd = Math.PI / 180.0;
// 2d vector [x, y] library
var Vec2 = {
cacheSize: 64,
cache: [ ],
clear: function() {
this.cache = [ ];
},
@transitive-bullshit
transitive-bullshit / billboard_sao.frag
Created September 30, 2013 21:08
WebGL GLSL SAO (Scalable Ambient Obscurance) fragment shader. SAO is a more efficient method for computing SSAO (Screen-Space Ambient Occlusion). Converts the g-buffer to an occlusion buffer which estimates local ambient occlusion at each fragment in screen-space. For details on the technique itself, see: McGuire et al [12] http://graphics.cs.wi…
// total number of samples at each fragment
#define NUM_SAMPLES {{ numSamples }}
#define NUM_SPIRAL_TURNS {{ numSpiralTurns }}
#define USE_ACTUAL_NORMALS {{ useActualNormals }}
#define VARIATION {{ variation }}
uniform sampler2D sGBuffer;
@ryanfitz
ryanfitz / golang-nuts.go
Created December 2, 2012 22:45
two ways to call a function every 2 seconds
package main
import (
"fmt"
"time"
)
// Suggestions from golang-nuts
// http://play.golang.org/p/Ctg3_AQisl