Skip to content

Instantly share code, notes, and snippets.

@debreczeni
debreczeni / search_29ers_on_bikemag_apro.rb
Last active December 19, 2015 04:08
search for 29er mountain bikes on apro.bikemag.hu
#!/usr/bin/env ruby
require 'mechanize'
# require 'awesome_print'
# require 'pry-debugger'
class TwentyNiner
def initialize
@index_page_url = 'http://apro.bikemag.hu/browse/mountain-bike/mtb-kerekpar/'
@wheel_size = /29/
// csikozas
#virtuall > tbody > tr.alt2 > td:nth-of-type(2) { background:#B6D8F5; }
// tabla kerekites
#virtuall { border-collapse:separate; }
#virtuall td, #virtuall th { border:1px solid #000000; border-width: 1px 1px 0 0;}
#virtuall tr:first-child th:first-child { -moz-border-radius-topleft: 10px; -webkit-border-top-left-radius: 10px; border-top-left-radius: 10px; }
#virtuall tr:first-child th:last-child { -moz-border-radius-topright: 10px; -webkit-border-top-right-radius: 10px; border-top-right-radius: 10px; }
#virtuall tr:last-child td:first-child { -moz-border-radius-bottomleft: 10px; -webkit-border-bottom-left-radius: 10px; border-bottom-left-radius: 10px; }
#virtuall tr:last-child td:last-child { -moz-border-radius-bottomright: 10px; -webkit-border-bottom-right-radius: 10px; border-bottom-right-radius: 10px; }
@debreczeni
debreczeni / iban.rb
Created January 14, 2016 18:59
GIRO to IBAN converter in ruby
class IBAN
def self.sanitize(account_number)
account_number.gsub(/\D*/, '')
end
def self.giro2iban(giro, country_code = 'HU')
giro = sanitize giro
country_code.upcase!
unless giro.size == 16 || giro.size == 24
@debreczeni
debreczeni / zendesk_ticket_and_comment_search_by_email.rb
Last active February 1, 2019 18:11
Zendesk Ticket search based on search query like "email@address.com" and with results including comments. Using the official Zendesk API v2 ruby gem: https://github.com/zendesk/zendesk_api_client_rb
require 'zendesk_api'
class Zendesk
attr_accessor :client
def initialize
@client = ZendeskAPI::Client.new do |config|
# Mandatory:
config.url = "<- your-zendesk-url ->" # e.g. https://mydesk.zendesk.com/api/v2

Keybase proof

I hereby claim:

  • I am debreczeni on github.
  • I am davidd (https://keybase.io/davidd) on keybase.
  • I have a public key ASC9WKA5kVQL0IDNxksA0K6woBL5EQaeDvWJfOfMBV0WFAo

To claim this, I am signing this object:

@debreczeni
debreczeni / git-show-big-files.sh
Created May 2, 2012 16:41
Find large files in git repository
#!/bin/bash
#set -x
# Shows you the largest objects in your repo's pack file.
# Written for osx.
#
# @see http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/
# @author Antony Stubbs