Skip to content

Instantly share code, notes, and snippets.

View mbj's full-sized avatar

Markus Schirp mbj

View GitHub Profile
@mbj
mbj / pricingResCookie.parts.js
Created November 8, 2012 21:05
Why does sixt.de hide they are stealing my history?
// http://www.sixt.de/static/oi/js/pricingResCookie.js | 2012-11-08 21:56 UTC+2
// Loaded when visiting http://www.sixt.de Line 1178.
// Lines: 821-853 with decoded base64 in comments.
// checkHistory() does CSS :visited based history stealing.
// The privacy policy does not reflect they are hitting my privacy with this. Somewhere deeper in the code they are
// checking for: something-even-more-private.com? I dislike such stuff, how far do they want to go?
// German privacy policy under: http://www.sixt.de/informationen/datenschutz/
// I'm not a so happy customer anymore.
var ep = [
@mbj
mbj / address.rb
Last active January 4, 2016 03:29
morpher
require 'morpher'
extend Morpher::NodeHelpers
class Address
include Anima.new(:street)
end
class Person
include Anima.new(:address)
end
@mbj
mbj / hybrid.rb
Created January 16, 2014 22:06
morpher hybrid mode
module Morpher
class Hybrid
include Evaluator::Unary
def call(input)
Evaluation.success(
:input => input,
:output => node.call(input)
)
rescue Morpher::TransformError
@mbj
mbj / output.txt
Created January 6, 2014 15:22
ruby returns take blocks?
mbj@mbj ~/devel/unparser (master*) % bundle exec ruby-parse return-a.rb return-b.rb
Using Parser::Ruby21 to parse 2 files.
(block
(return
(send nil :foo
(send nil :arg)))
(args
(arg :bar)) nil)
(return
(block
@mbj
mbj / ast.txt
Created January 2, 2014 17:38
multiple assignment AST in ruby
mbj@mbj ~/devel/mutant (master) % bundle exec ruby-parse -e 'a.foo, a[1], b[] = b, *c' <<<
(masgn
(mlhs
(send
(send nil :a) :foo=)
(send
(send nil :a) :[]=
(int 1))
(send
(send nil :b) :[]=))
@mbj
mbj / debug.txt
Created December 1, 2013 19:25
Negative zero vs positive zero inconsistency in various rubies.
mbj@mbj ~/devel/mutant (master*) % chruby jruby
mbj@mbj ~/devel/mutant (master*) % irb test.rb
test.rb(main):001:0> RUBY_ENGINE
=> "jruby"
test.rb(main):002:0> RUBY_VERSION
=> "1.9.3"
test.rb(main):003:0> 0.0 == -0.0
=> true
test.rb(main):004:0> -0.0 == 0.0
=> true
@mbj
mbj / gist:7473268
Created November 14, 2013 19:54
anima mutations
Anima::Builder#define_anima_method:/home/mbj/devel/anima/lib/anima/builder.rb:98
evil:Anima::Builder#define_anima_method:/home/mbj/devel/anima/lib/anima/builder.rb:98:3ce76
@@ -1,8 +1,8 @@
def define_anima_method
- descendant_exec(@anima) do |anima|
+ descendant_exec(@anima) do |s5cddc71c5388531691ae|
define_singleton_method(:anima) do
anima
end
end
@mbj
mbj / illustrative_ducktrap.rb
Last active December 25, 2015 07:19
Illustrative ducktrap example:
require 'ducktrap'
# Very simple ducktrap without any real world use
#
# Not transforming.
#
string = Ducktrap.build do
primitive(String)
end
@mbj
mbj / private_class_methods.rb
Created September 9, 2013 13:57
protected class methods in ruby
class Foo
def self.bar
:baz
end
end
Foo.bar # => :baz, public
class Foo
class << self
@mbj
mbj / pushing.txt
Last active December 22, 2015 02:48
pushing unparser-0.0.18
mbj@mbj ~/devel/unparser (master*) % gem push unparser-0.0.18.gem <<<
Pushing gem to https://rubygems.org...
<html>
<head><title>500 Internal Server Error</title></head>
<body bgcolor="white">
<center><h1>500 Internal Server Error</h1></center>
<hr><center>nginx</center>
</body>
</html>