Skip to content

Instantly share code, notes, and snippets.

View tistre's full-sized avatar

Tim Strehle tistre

View GitHub Profile
@tistre
tistre / cookies_from_raw_http_response.php
Created April 7, 2014 08:36
Parse cookies from raw HTTP response using PHP’s pecl_http
<?php
$msg = <<<EOT
HTTP/1.1 200 OK
Date: Mon, 07 Apr 2014 08:29:07 GMT
Server: Apache/2.2.15 (CentOS)
X-Powered-By: PHP/5.3.20
Set-Cookie: dcx_app_trunk=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/dcx_trunk/
Set-Cookie: dcx_app_trunk=33mnkpiau2s80uhrtb7a105l23; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
@tistre
tistre / gist:9239838
Last active August 29, 2015 13:56
Bookmarklet to open the dialog for creating a Google Calendar event from a MantisBT issue detail page. Quick & dirty, works for me.
javascript: var title = 'Mantis #' + document.title.substring(2, (document.title.length - 11)); var url = 'https://www.google.com/calendar/render?action=TEMPLATE&sf=true&output=xml&text=' + encodeURIComponent(title) + '&details=' + encodeURIComponent('Details in Mantis: ' + location.href); window.open(url, 'mantisgcal', 'scrollbars=yes,width=1200,height=800,top=175,left=75,status=no,resizable=yes'); if (!document.all) T = (setTimeout('popw.focus()',50)); void(0);