Skip to content

Instantly share code, notes, and snippets.

View coderofsalvation's full-sized avatar

Coder of Salvation / Leon van Kammen coderofsalvation

View GitHub Profile
@eladg
eladg / Equirectangular-to-Stereographic-Projection-Shader.frag
Last active March 29, 2017 06:42
WebGL: stereoscopic projection transformation (Fragment Shader)
// credits to: https://github.com/notlion/streetview-stereographic
precision mediump float;
uniform sampler2D texture;
uniform float scale, aspect, time;
uniform mat3 transform;
varying vec2 v_texcoord;
@fcamblor
fcamblor / lodash-3.9.3-appscript.js
Last active November 18, 2020 09:53
Lodash 3.9.3 compat with google appscript
/**
* @license
* lodash 3.9.3 (Custom Build) <https://lodash.com/>
* Build: `lodash modern -o ./lodash.js`
* Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license <https://lodash.com/license>
*/
;(function() {
ffmpeg \
-i dance_addition.mp4 \
-i dance_and.mp4 \
-i dance_average.mp4 \
-i dance_blend.mp4 \
-i dance_burn.mp4 \
-i dance_darken.mp4 \
-i dance_difference.mp4 \
-i dance_divide.mp4 \
-i dance_dodge.mp4 \
@thykka
thykka / line-fonts.lua
Last active October 3, 2021 18:12
Line Fonts for PICO-8
--[[
line fonts v0.1 - thykka 2021
==usage==
printl(
text,
x, y,
color,
font_size,
@joeladdison
joeladdison / youtube-test.sh
Created January 16, 2017 08:40
Test stream for YouTube Live
#!/bin/sh
YT_SERVER="rtmp://a.rtmp.youtube.com/live2"
# Needs AUTH, which is the "Stream Name" from Ingestion Settings > Main Camera
# apt-get install --assume-yes gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-tools
# https://bugzilla.gnome.org/show_bug.cgi?id=731352#c6
@gsanders5
gsanders5 / example.nginx
Last active August 18, 2022 06:20
Automatic nginx virtual subdomains with sub-folders or sub-directories
# Automatic nginx virtual subdomains with sub-folders or sub-directories
#
# Since the original source where I found this code is now offline, I have decided to mirror it here.
# All credit goes to: http://web.archive.org/web/20150307193208/http://www.messaliberty.com/2010/10/automatic-nginx-virtual-subdomains-with-sub-folders-or-sub-directories
#
# Description: In my web root directory I wanted create a folder called photos, and another called
# music using a sftp program. Without manually going back to the config file or to the shell I like to
# be able to access them at photos.nginxdomain.com and music.nginxdomain.com. That is what this config does.
# Redirect visitors from http://nginxdomain.com/ to http://www.nginxdomain.com/
@coderofsalvation
coderofsalvation / eco-friendly-tiny-server-patterns.md
Last active November 3, 2022 10:25
My favorite (awesome) eco-friendly server patterns

tiny servers: the serverpark killers

auto-suspend-wakeup webservices

stop wasting cpu/mem-resources on idling services:

#!/bin/sh
while sleep 1s; do
 set +e
@modest
modest / twowayrsync
Created March 2, 2021 07:10
Two-way folder sync with rsync - Inefficient but portable
#!/usr/bin/env bash
remoteuser="$1"
remotehost="$2"
remotedir="$3"
localdir="$4"
syncstatusfile=".lastsync"
if [[ ! -d "$4" ]]; then
@amark
amark / li.html
Last active April 30, 2023 05:25
<html><body>
<style>
html, body {
background: rgb(245, 245, 245);
margin: 0;
padding: 0;
}
div {
position: relative;
overflow: hidden;
@take-cheeze
take-cheeze / test.cpp
Created June 21, 2014 06:49
Playing MIDI with fluidsynth on OpenAL.
#include <OpenAL/al.h>
#include <OpenAL/alc.h>
#include <boost/assert.hpp>
#include <cstdint>
#include <cstdlib>
#include <chrono>
#include <iostream>