Skip to content

Instantly share code, notes, and snippets.

View rjocoleman's full-sized avatar

Robert Coleman rjocoleman

  • Christchurch, New Zealand
View GitHub Profile
@elidickinson
elidickinson / utmstrip.js
Last active May 24, 2016 08:29 — forked from paulirish/utmstrip.user.js
Strips visible utm_ strings off URLs on your site, but makes sure Google Analytics tracks them first
// utmstrip.js strips utm_* strings from the URL bar of your site, but afer Google Analytics
// has had a chance to grab them. Based on Paul Irish's utm-stripping user script.
//
// Source: https://gist.github.com/elidickinson/9128677
//
// Install Notes:
// - This script should run *after* you have added all your "_trackPageview" or "_trackEvent"
// calls to the _gaq variable.
// - It doesn't matter of Google Analtyics has actually finished loading yet, but if you
// you tell it to strip the utm_* strings before _trackPageview sees them, it won't know
@parzonka
parzonka / widescreen_with_thread_arcs.plist
Last active December 12, 2015 03:29
Custom MailMate (http://freron.com) layout for Mailboxes view. Extends the installed widescreen layout by adding a vertical thread arcs view at the right. See screen shot at https://www.dropbox.com/s/ujdz5mgifhpq8ke/mailmate-widescreen-threadarcs.png . Save it to `~/Library/Application Support/MailMate/Resources/Layouts/Mailboxes/widescreen_with…
/* Custom MailMate (http://freron.com) layout for Mailboxes view. Extends the installed widescreen
layout by adding a vertical thread arcs view at the right. Save it to
"~/Library/Application Support/MailMate/Resources/Layouts/Mailboxes/widescreen_with_thread_arcs.plist"
and it will be available after a restart of MailMate. */
{
name = "Widescreen with Thread Arcs";
rootViewer =
{
viewerType = "MmSplitView";
@sud0n1m
sud0n1m / premailer_monkey_path.rb
Created October 28, 2012 22:27
An initializer we added so premailer supports @media queries.
# Patched to no process @media queries in <style> blocks.
# For HTML emails, @media queries are exclusively used for
# targeting mobile clients. These should not be inlined.
class CssParser::Parser
def parse_block_into_rule_sets!(block, options = {}) # :nodoc:
current_media_queries = [:all]
if options[:media_types]
current_media_queries = options[:media_types].flatten.collect { |mt| CssParser.sanitize_media_query(mt)}
end
@jimcroft
jimcroft / gist:3878113
Last active March 20, 2018 14:21
Enable WinRM for Chef bootstrapping via EC2 user data
<powershell>
winrm quickconfig -q
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="300"}'
winrm set winrm/config '@{MaxTimeoutms="1800000"}'
winrm set winrm/config/service '@{AllowUnencrypted="true"}'
winrm set winrm/config/service/auth '@{Basic="true"}'
netsh advfirewall firewall add rule name="WinRM 5985" protocol=TCP dir=in localport=5985 action=allow
netsh advfirewall firewall add rule name="WinRM 5986" protocol=TCP dir=in localport=5986 action=allow
@robinsmidsrod
robinsmidsrod / _INSTALL.md
Last active March 21, 2024 23:00
Bootstrapping full iPXE native menu with customizable default option with timeout (also includes working Ubuntu 12.04 preseed install)

Add the following chunk to your existing ISC dhcpd.conf file.

if exists user-class and ( option user-class = "iPXE" ) {
    filename "http://boot.smidsrod.lan/boot.ipxe";
}
else {
    filename "undionly.kpxe";
}

(or see https://gist.github.com/4008017 for a more elaborate setup

@troy
troy / send_remote_syslog.php
Last active April 6, 2023 18:19
Send UDP remote syslog message from PHP (RFC 3164)
# replace PAPERTRAIL_HOSTNAME and PAPERTRAIL_PORT
# see http://help.papertrailapp.com/ for additional PHP syslog options
function send_remote_syslog($message, $component = "web", $program = "next_big_thing") {
$sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
foreach(explode("\n", $message) as $line) {
$syslog_message = "<22>" . date('M d H:i:s ') . $program . ' ' . $component . ': ' . $line;
socket_sendto($sock, $syslog_message, strlen($syslog_message), 0, PAPERTRAIL_HOSTNAME, PAPERTRAIL_PORT);
}
socket_close($sock);