This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Kernel | |
def meta | |
class << self; self; end | |
end | |
end | |
class Module | |
public :attr_accessor, :attr_reader, :attr_writer | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def otool | |
puts self | |
%x[otool -L #{self}].each_line.grep(/\t(.*)/) do | |
$1.gsub(/(\(.*?\))/,'').strip | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
begin | |
require 'sequel' | |
rescue LoadError | |
puts "Please run gem install sequel" | |
exit! | |
end | |
DB = Sequel.connect(:adapter => 'mysql2', | |
:host => '127.0.0.1', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TheFoo | |
module Base | |
def initialize | |
@foo = "foo" | |
end | |
def foo | |
@foo = "baz" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ApplicationHelper | |
def slugged(field, path_method, record) | |
[self.send(path_method, record), record.send(field).parameterize].join("/") | |
end | |
end | |
# then in your view | |
<%= link_to post.title, slugged(:title, :post_path, post) %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PidLock | |
def initialize(name, &block) | |
@name = name | |
if can_execute? | |
set_running | |
block.call | |
else | |
puts "the pidfile #{pidfile} is locked by process #{current_pid}" | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Greeter | |
def greet | |
"hello" | |
end | |
end | |
module ItalianGreeter | |
def greet | |
"ciao" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GCC-4.2 | |
pigoz@NAVI ~/dev/mplayerosx-builds ±master⚡ » mplayer2 -benchmark -vo null -nosound /Users/pigoz/Yarr\ Downloads/\[Coalgirls\]_Kampfer_OP_\(1280x720_Blu-Ray_FLAC\)_\[8668AB91\].mkv | |
BENCHMARKs: VC: 12.182s VO: 5.356s A: 0.000s Sys: 0.572s = 18.110s | |
BENCHMARK%: VC: 67.2649% VO: 29.5761% A: 0.0000% Sys: 3.1590% = 100.0000% | |
# LLVM | |
pigoz@NAVI ~/dev/mplayerosx-builds ±llvm⚡ » mplayer2 -benchmark -vo null -nosound /Users/pigoz/Yarr\ Downloads/\[Coalgirls\]_Kampfer_OP_\(1280x720_Blu-Ray_FLAC\)_\[8668AB91\].mkv | |
BENCHMARKs: VC: 20.472s VO: 6.064s A: 0.000s Sys: 0.605s = 27.141s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VO: [gl] 1920x1080 => 1920x1080 Planar 420P 10-bit little-endian | |
Reading symbols for shared libraries . done | |
A: 31.3 V: 31.2 A-V: 0.014 ct: 0.000 0/ 0 14% 2% 0.8% 36 0 | |
Program received signal EXC_BAD_ACCESS, Could not access memory. | |
Reason: KERN_INVALID_ADDRESS at address: 0x00000001052f5ffc | |
[Switching to process 33890 thread 0x6107] | |
0x000000010079a1df in put_hv4_10_mmxext.v_loop () | |
(gdb) bt | |
#0 0x000000010079a1df in put_hv4_10_mmxext.v_loop () | |
#1 0x000000010079ac22 in stub_put_h264_qpel4_mc21_10_mmxext.body () |
OlderNewer