Skip to content

Instantly share code, notes, and snippets.

View julik's full-sized avatar
💭
🎺

Julik Tarkhanov julik

💭
🎺
View GitHub Profile
class Foo
attr_reader :opt
def initialize(opt)
@opt = opt
end
def meth_in_bar
:from_foo
end
end
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
@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
@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 / 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 / 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 / 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();
from __future__ import with_statement
import nuke, nukescripts, os, re
# On the current node, add a userknob for the framecurve
def add_framecurve(onNode):
framecurveKnob = nuke.Double_Knob("framecurve", "timewarp frame")
framecurveKnob.setTooltip( "This contains the retiming framecurve animation")
onNode.addKnob(framecurveKnob)
onNode["framecurve"].setAnimated()
onNode["framecurve"].setValueAt(1.0, 1)
@julik
julik / convert.sh
Created May 18, 2011 16:04
Convert a batch of images to TIFF
$ sips -s format tiff /mnt/he_projects/Julik/PictConvert/Inception/*.pct --out /mnt/he_projects/Julik/PictConvert/Inception
@julik
julik / dasburo.txt
Created June 14, 2011 18:38
Sample session in dasburo DPX media manager
review:dasburo julik$ ./dasburo --list
In project Herocomplex
Projects in the büro
Herocomplex
storm
target
Trains
review:dasburo julik$ ./dasburo --help
In project Herocomplex
Usage: dasburo [options]