NOTE: This post now lives (and kept up to date) on my blog: http://hakunin.com/rails3-load-paths
Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.
| # Somehow Firefox 3 on Flame Oldest Linux In The Universe | |
| # gets the .tgz files double-cooked compressed. This MW is | |
| # intrduced to verify why that happens | |
| class HeaderSniffer | |
| def initialize(app, path_regexp = /\.tgz/) | |
| @path_regexp = path_regexp | |
| @app = app | |
| end | |
| def call(env) |
| curl http://logik-matchbook.org/MatchboxShaderCollection.tgz | tar xfz -; cp -r shaders /wherever-you-want/ |
| curl http://logik-matchbook.org/MatchboxShaderCollection.tgz | tar xfz - && ./INSTALL.command |
| require 'openssl' | |
| def digest_file(file_path, digest_class) | |
| chunk_size = 1024 * 1024 # a meg | |
| d = digest_class.new | |
| File.open(file_path, 'r') do | f | | |
| while chunk = f.read(chunk_size) do | |
| d << chunk | |
| end | |
| end |
NOTE: This post now lives (and kept up to date) on my blog: http://hakunin.com/rails3-load-paths
Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.
| TERMINATORS = ["\n", ";"] | |
| ESC = "\\" | |
| QUOTES = ['"', "'"] | |
| class c: | |
| """ | |
| Will be at the start of a list representing an expression | |
| in curly braces. Every c() is equal to any other c() | |
| """ |
| var exportToDir = "/Users/julik/Code/apps/mvp/public/icons/"; | |
| /* Crop every icon in your Illustrator file witha named artboard. This script will export them all */ | |
| var docRef = app.activeDocument; | |
| docRef.save(); | |
| // Get the source path | |
| var originalPath = app.activeDocument.fullName.toString(); | |
| // Allocate a copy of the current document that we will throw away. We do this |
| uniform sampler2D input1; | |
| uniform float adsk_input1_w, adsk_result_w; | |
| void main() | |
| { | |
| // this should output the width of the input1 into the G channel of the shader, | |
| // but it's value is always zero. And it wasn't. The test_shader stipulates that | |
| // adsk_{sampler_name}_w / adsk_{sampler_name}_h : when declared as a float | |
| // uniform, this gives access to each texture's resolution | |
| // but it's broken now |
| // Detect Control/Shift/Alt key status | |
| var CTRL = false; | |
| var SHIFT = false; | |
| var ALT = false; | |
| var CHAR_CODE = -1; | |
| var menuItemDiv = null; | |
| var curMouseX, curMouseY; |
| readgeo = nuke.selectedNode() | |
| # register the first frame of the selected readgeo | |
| hold_first = int(readgeo["range_first"].value()) | |
| # and the last frame | |
| hold_last = int(readgeo["range_last"].value()) | |
| # generate the holds | |
| hold_before = nuke.nodes.FrameHold(first_frame = hold_first) | |
| hold_before.setInput(0, readgeo) |