Skip to content

Instantly share code, notes, and snippets.

#!/bin/zsh
# Copyleft 2010 paradoxxxzero All wrongs reserved
# With contribution from James Ahlborn
# https://gist.github.com/752727
# Fork of https://gist.github.com/586698 by nicoulaj / dingram / roylzuo ...
# From http://www.zsh.org/mla/users/2010/msg00692.html
# Token types styles.
# See http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#SEC135
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active May 17, 2024 02:53
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@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;
@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active May 30, 2024 20:42
GLSL Noise Algorithms

Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
@kylemcdonald
kylemcdonald / gcd.cpp
Last active August 29, 2015 14:07
Grand central dispatch examples courtesy of @HalfdanJ
// group of for loops with waiting
int m, n;
dispatch_group_t group = dispatch_group_create();
dispatch_group_async(group, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH,0), ^{
// before all parallel m
dispatch_apply(m, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^(size_t i) {
// parallel m code with i for index
});
// after all parallel m
});
@awidegreen
awidegreen / pia_swe.ovpn
Last active November 4, 2022 00:26
rtorrent through openvpn
client
dev tun
# "Allow calling of built-in executables and user-defined scripts." In other
# words, this must be specified for the `up` script to be executed.
script-security 2
route-nopull
up vpn-up.sh
down vpn-down.sh
@chrismdp
chrismdp / s3.sh
Last active March 5, 2024 12:57
Uploading to S3 in 18 lines of Shell (used to upload builds for http://soltrader.net)
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1
@sebleblanc
sebleblanc / Installing Flexget.md
Last active December 30, 2017 10:35
Installing flexget in a virtualenv

To avoid clashes with packages installed on your system, FlexGet can be installed in a Python virtualenv. A virtualenv is similar to a chroot, but specific to Python packages. Creating a virtualenv is a simple process. The virtualenv will contain its own Python interpreter and its own versions of downloaded dependencies, separate from the system's packages.

Creating a virtualenv is a standard procedure in a Python web application deployment.

Let's create a folder in which to create the virtualenv:

mkdir ~/virtualenv # or any name you prefer
cd ~/virtualenv

Now, create the virtualenv itself and make it relocatable. For some reason, we have to create a regular virtualenv before making it relocatable:

@paniq
paniq / ecs.md
Last active May 27, 2023 10:34
Entity Component Systems
@danhett
danhett / contract.md
Last active July 6, 2020 17:57 — forked from brendandawes/Dawesome Design Contract.md
A contract for creative technologist/development services.

This is simple, clear and concise contract that I use for general creative and technical projects. It's based largely upon Brendan Dawe's excellent open-source design contract, but has been modified to contain more appropriate terminology for my field, and now contains sections pertaining to source code, ongoing support, NDA's etc.

Please feel free to fork, modify, distribute and use this document as you wish - and please please do use it. Do not start work without a contract, ever. Additionally: DO NOT START WORK WITHOUT A CONTRACT, EVER.

Agreement for commission of work between:

Dan Hett ("Developer", "me", "I")

and:

[CLIENT NAME] ("Client", "you")