Skip to content

Instantly share code, notes, and snippets.

View akostadinov's full-sized avatar

Aleksandar N. Kostadinov akostadinov

View GitHub Profile
@akostadinov
akostadinov / fb2ical.php
Last active August 29, 2015 14:09 — forked from phibo23/fb2ical.php
<?php
/*
original code by cogitom: https://gist.github.com/997980/
phibo23: https://gist.github.com/2808256/
This script reads future events (plus several days into the past) from Facebook pages
and creates a subscribable iCalendar
Improvements upon the original version:
- avoid setting DTEND field if facebook event lacks an end time
@akostadinov
akostadinov / add_child_ns_nokogiri_bug.rb
Last active June 9, 2016 09:49 — forked from gioele/add_child_ns.rb
Nokogiri `add_child` does not copy namespaces
#!/usr/bin/env ruby
# see https://github.com/sparklemotion/nokogiri/issues/1200
require 'nokogiri'
src =<<EOD
<wrapper xmlns="ns">
<record xml:id="r1" xmlns:extra="extra">
<field>aaa</field>
@akostadinov
akostadinov / _http_continue.txt
Last active March 28, 2018 12:47 — forked from trevorrowe/client.rb
Ruby Net::HTTP Expect-100 continue PUT bug
# Start the sample server. This server alternates between responding with 100-continue and
# resopnding with a 403 Forbidden. The client **should** be able to handle both responses.
$ ruby server.rb
# In another terminal window, run the client code twice. The first invocation will succeed.
# The second invocation will fail the client with an error.
$ ruby client.rb
$ ruby client.rb