Skip to content

Instantly share code, notes, and snippets.

View leiteg's full-sized avatar
💭

Gustavo Leite leiteg

💭
View GitHub Profile
anonymous
anonymous / gist:7200880
Created October 28, 2013 17:20
Processing motion blur
/* passable motion blur effect using frame blending
* basically move your 'draw()' into 'sample()', time runs from 0 to 1
* by dave
* http://beesandbombs.tumblr.com
*/
int samplesPerFrame = 32; // more is better but slower. 32 is enough probably
int numFrames = 48;
float shutterAngle = 2.0; // this should be between 0 and 1 realistically. exaggerated for effect here
int[][] result;
bind-key C-b send-prefix
bind-key C-o rotate-window
bind-key C-z suspend-client
bind-key Space next-layout
bind-key ! break-pane
bind-key " split-window
bind-key # list-buffers
bind-key $ command-prompt -I #S "rename-session '%%'"
bind-key % split-window -h
bind-key & confirm-before -p "kill-window #W? (y/n)" kill-window
@kwk
kwk / CMakeLists.txt
Last active April 3, 2021 18:17
Standalone Clang project (outside of LLVM and Clang source tree)
cmake_minimum_required(VERSION 2.8.8)
project(interface_class_printer)
option(BUILD_INTERFACE_CLASS_PRINTER "Build the tool that converts a C++ interface class into a C struct." ON)
mark_as_advanced(BUILD_INTERFACE_CLASS_PRINTER)
if (BUILD_INTERFACE_CLASS_PRINTER)
# Find boost
find_package(Boost COMPONENTS date_time REQUIRED)
anonymous
anonymous / gist:10675250
Created April 14, 2014 19:11
Motion Blur + Chromatic Aberration
// by dave @ beesandbombs.tumblr.com >:)
void setup() {
setup_();
result = new int[width*height][3];
result_ = new int[width*height][3];
}
int[][] result, result_;
float time;
anonymous
anonymous / collab.pde
Created October 4, 2014 14:50
Processing collab example code - metaglitch.com
// Code by @MetaGlitch
float fps = 16.666;
int inFrames = 15;
int outFrames = 15;
int otherFrames = 60;
int numFrames = inFrames + otherFrames + outFrames;
float t1 = inFrames * 1.0/numFrames;
anonymous
anonymous / maze.pde
Created November 6, 2014 14:00
Solution for sharkverse's maze solving challenge
// Code by @MetaGlitch
int size = 601;
int fps = 20;
int numFrames = 40;
int samplesPerFrame = 24;
float exposure = 0.7; // exposure time in frames. >1 allowed for blending multiple frames
float subFrameAttenuation = 1; // 1 for weighting every subframe the same. <1 for attenuation effect.
boolean looping = true; // false: t=1 on the last frame; true: t=1-1/nummFrames on last frame.
boolean recording = true;
@craffel
craffel / draw_neural_net.py
Created January 10, 2015 04:59
Draw a neural network diagram with matplotlib!
import matplotlib.pyplot as plt
def draw_neural_net(ax, left, right, bottom, top, layer_sizes):
'''
Draw a neural network cartoon using matplotilb.
:usage:
>>> fig = plt.figure(figsize=(12, 12))
>>> draw_neural_net(fig.gca(), .1, .9, .1, .9, [4, 7, 2])
@joyrexus
joyrexus / README.md
Last active April 19, 2025 09:46 — forked from btoone/curl.md
curl tutorial

An introduction to curl using GitHub's API.

Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin

Includes HTTP-Header information in the output

@tanyuan
tanyuan / smart-caps-lock.md
Last active July 25, 2025 22:41
Smart Caps Lock: Remap Caps Lock to Control AND Escape

Smart Caps Lock: Remap to Control AND Escape (Linux, Mac, Windows)

Caps Lock 變成智慧的 Control 以及 Escape

  • 單獨輕按一下就是 Escape
  • 若按下時同時按著其他鍵,就會是 Control

這應該是 Vim 和 Emacs 的最佳解了!(Emacs? Bash 的快捷鍵就是 Emacs 系列的)

  • Send Escape if you tap Caps Lock alone.
@CMCDragonkai
CMCDragonkai / memory_layout.md
Last active June 24, 2025 19:56
Linux: Understanding the Memory Layout of Linux Executables

Understanding the Memory Layout of Linux Executables

Required tools for playing around with memory:

  • hexdump
  • objdump
  • readelf
  • xxd
  • gcore