Skip to content

Instantly share code, notes, and snippets.

View pigoz's full-sized avatar
:octocat:

Stefano Pigozzi pigoz

:octocat:
View GitHub Profile
/*! --------------------------------------------------------------------------
@group Font Cascading
*///--------------------------------------------------------------------------
/*!
@function CTFontCreateForString
@abstract Returns a new font reference that can best map the given string range based on the current font.
@discussion This function is to be used when the current font does not cover the given range of the string. The current font itself will not be returned, but preference is given to fonts in its cascade list.
class MpvReply < Struct.new(:value, :status)
def ok?
status == :ok
end
def to_s
(ok? ? value : status).to_s
end
end
class Struct
def self.kw(*args, **kwargs)
raise ArgumentError, "use only keyword arguments" unless args.empty?
new.tap do |instance|
kwargs.each { |k,v| instance[k] = v }
end
end
end
FooBarBaz = Struct.new(:foo, :bar, :baz)
loaded = false
if (not loaded) then
invoke("std", "LoadPlugin", {path = "/usr/local/lib/libf3kdb.dylib"})
loaded = true
end
clip = video_in
clip = invoke("std", "Trim", {clip = clip, i_first = 0, i_length = 500000})
clip = invoke("f3kdb", "Deband", {clip = clip, i_grainy = 0, i_grainc = 0, i_output_depth=16})
angular.module('httpProgress')
.factory('httpProgressInterceptor', function($q) {
var requestCount = 0;
function updateProgress(update) {
var previous = requestCount;
requestCount += update;
if(previous <= 0 && requestCount > 0) {
NProgress.start();
pigoz@NAVi ~/dev/libass-ct ±fonts⚡ » sh ~/dev/libass-tests/test-libass.sh
test.c: Available font providers (4): 'None', 'Autodetect', 'CoreText', 'Fontconfig'.
libass: Raster: FreeType 2.5.5
libass: Shaper: FriBidi 0.19.6 (SIMPLE) HarfBuzz-ng 0.9.40 (COMPLEX)
libass: Initialized
libass: File size: 1460
libass: [0x7fcdf8c18fa0] Style: times,serif,72,&H00F5FDFF,&H000000FF,&H00391703,&H64444487,0,1,0,0,100,105,1,0,1,4,1.1,2,100,100,40,1
libass: [0x7fcdf8c18fa0] Style: myriad,Myriad Pro Bold,72,&H00F5FDFF,&H000000FF,&H00391703,&H64444487,0,0,0,0,100,105,1,0,1,4,1.1,2,100,100,40,1
libass: [0x7fcdf8c18fa0] Style: myriad,Comic-Sans,172,&H00F5FDFF,&H000000FF,&H00391703,&H64444487,0,1,0,0,100,105,1,0,1,4,1.1,2,100,100,40,1
libass: [0x7fcdf8c18fa0] Style: arial,Arial,200,&H00F5FDFF,&H000000FF,&H00391703,&H64444487,0,1,0,0,100,105,1,0,1,4,1.1,2,100,100,40,1
@pigoz
pigoz / gist:e4fb8329409a154c2ca2
Created August 7, 2015 16:23
please help it's technical
18:21:45 gitter -- ? irc: connecting to server irc.gitter.im/6667 (SSL)...
18:21:45 gitter -- ? gnutls: connected using 2048-bit Diffie-Hellman shared secret exchange
18:21:45 gitter -- ? gnutls: receiving 2 certificates
18:21:45 gitter -- ? - certificate[1] info:
18:21:45 gitter -- ? - subject `OU=Domain Control Validated,OU=Gandi Standard Wildcard SSL,CN=*.gitter.im', issuer `C=FR,O=GANDI SAS,CN=Gandi Standard SSL CA', RSA key 2048 bits, signed using RSA-SHA1,
? activated `2014-10-27 00:00:00 UTC', expires `2015-11-20 23:59:59 UTC', SHA-1 fingerprint `0f519b2d14ede0a82689ef42e328403fda5052a2'
18:21:45 gitter -- ? - certificate[2] info:
18:21:45 gitter -- ? - subject `C=FR,O=GANDI SAS,CN=Gandi Standard SSL CA', issuer `C=US,ST=UT,L=Salt Lake City,O=The USERTRUST Network,OU=http://www.usertrust.com,CN=UTN-USERFirst-Hardware', RSA key 2048
? bits, signed using RSA-SHA1, activated `2008-10-23 00:00:00 UTC', expires `2020-05-30 10:48:38 UTC
module Kernel
def meta
class << self; self; end
end
end
class Module
public :attr_accessor, :attr_reader, :attr_writer
end
@pigoz
pigoz / rsi.rb
Created October 28, 2010 19:29
Siebel Scripting from Ruby using COM Data Control
require 'win32ole'
theApp = WIN32OLE.new('SiebelDataControl.SiebelDataControl.1')
cs = %{host="siebel://10.0.0.1:2321/Sieb78/EAIObjMgr_ita" Lang = "ITA"}
theApp.Login(cs, "uid", "password")
bo = theApp.GetBusObject("Order Entry Orders")
bc = bo.GetBusComp("Order Entry - Line Items")
def otool
puts self
%x[otool -L #{self}].each_line.grep(/\t(.*)/) do
$1.gsub(/(\(.*?\))/,'').strip
end
end