Skip to content

Instantly share code, notes, and snippets.

View bjesus's full-sized avatar

Yo'av Moshe bjesus

View GitHub Profile
@bjesus
bjesus / run-in-console.js
Created February 19, 2016 12:40
Read Haaretz with an ad blocker
CookieUtil.setCookie('HtzPusr', 'its-my-right-to-use-the-internet-as-i-want-to');
// This will make the website think you're a registered user.
// While allowing you to use an ad blocker, it should also
// allow to you "Zen Reading" mode etc'.
@bjesus
bjesus / sync
Created August 27, 2014 10:13
Keep inputs with the same name in sync (jQuery)
$("input[name]").bind("keyup paste", function() {
elm = $(this);
elm_name = elm.attr('name');
$('input[name='+elm_name+']').val( elm.val() )
});
@bjesus
bjesus / account.rb
Created August 30, 2011 13:27
DocumentNotFound with nested attributes
class Account
include Mongoid::Document
field :name, :type => String
field :surname, :type => String
has_and_belongs_to_many :kenim_rakaz, :class_name => 'Ken', :inverse_of => :rakazim
end