Skip to content

Instantly share code, notes, and snippets.

View julik's full-sized avatar
💭
🎺

Julik Tarkhanov julik

💭
🎺
View GitHub Profile
@julik
julik / timewarp.cof
Created March 23, 2011 00:06
CINEMA4D C.O.F.F.E.E. camera retimer tag
main(doc,op)
{
// Which frame to sample. Grab this from the userattr of the COFFEE tag!
var cofy = op->GetFirstTag();
// Gotcha - when rendering tags get reordered and coffee tag might not come first,
// so walk the fucking linked list until we arrive at the tag
while(cofy) {
if(instanceof(cofy, CoffeeExpressionTag)) break;
cofy = cofy->GetNext();
@julik
julik / comments_to_wxr.rb
Created February 26, 2011 14:08
Migrating a RYO comment system (in this case Inkpot) to Disqus
#!/usr/local/bin/ruby
$KCODE = 'u'
require 'rubygems'
gem "camping", "1.5.180"
require File.dirname(__FILE__) + '/app/inkpot'
# 2010-09-20 13:19:10
RFCT = "%Y-%m-%d %H:%M:%S"
@julik
julik / bindata_phail.rb
Created February 19, 2011 12:42
bindata_phail.rb
require "rubygems"
require "bindata"
class FileInfo < BinData::Record
string :magic, :length => 4 # Endianness (SDPX is big endian)
uint32 :image_offset # Offset to image data in bytes
end
# TypeError: unknown type 'uint32' in FileInfo
@julik
julik / pushin.txt
Created February 17, 2011 20:03
Pushing shots to the vendor's FTP server with timestamp verification and dir structure
bigbuk:Scripts julik$ ruby upload.rb
s01a is still in approvals: Доскан
s14a is still in approvals: Снег от Куна
s20b is still in approvals: Доскан
s23 is still in approvals:
s35 is still in approvals: 0.8
No matching render for s17!
No matching render for s20a!
Checking dirs: 100% |oooooooooooooooooooooooooooooooooooooooooo| Time: 00:00:00
Shot 01012706: 100% |oooooooooooooooooooooooooooooooooooooooooo| Time: 00:00:01
@julik
julik / edl_log.rb
Created January 20, 2011 17:46
Quickly log some clips for capturing from tape (outputs an EDL)
require "rubygems"
require "timecode"
class Caplist
class Evt
attr_reader :start, :upto
def initialize(from, upto_and_including)
@start = from
@upto = upto_and_including
require "delegate"
class EDL::LinebreakMagician < DelegateClass(IO)
def initialize(with_file)
sample = with_file.read(2048)
@linebreak = ["\r\n", "\r", "\n"].find{|separator| sample.include?(separator) }
with_file.rewind
__setobj__(with_file)
end
class Foo
attr_reader :opt
def initialize(opt)
@opt = opt
end
def meth_in_bar
:from_foo
end
end
set cut_paste_input [stack 0]
version 6.0 v7
push $cut_paste_input
Group {
name GrowFront
selected true
xpos -465
ypos -223
addUserKnob {20 growfront l GrowFront}
addUserKnob {41 grow T GrowBlur.size}
# We send this as a response object. Rack can use any object that responds to each() as
# response body. When each() is called, the object
# will activate the FTP connection and couple the FTP receive loop with the HTTP send loop.
# This will probably go totally kaput on shitservers like Webrick that still insist on buffering
# any output, but someone who uses Webrick can better shoot himself on the spot. Since
# we provide range support, we need to pass it downstream to the FTP server and we need to send
# exactly the amount of bytes requested to satisfy range.
class Fatpete::FTPStream
CHUNK_SIZE = 128 * 1024
SLEEP_BETWEEN_CHUNKS = 0.1
RotoPaint {
toolbar_brush_hardness 0.200000003
toolbar_lifetime_type all
toolbar_source_transform_scale {1 1}
toolbar_source_transform_center {1024 778}
output alpha
premultiply rgb
curves {AnimTree: "" {
Version: 1.2
Flag: 0