Skip to content

Instantly share code, notes, and snippets.

View Marthyn's full-sized avatar

Marthyn Olthof Marthyn

View GitHub Profile
# mailboxes/concerns/mail_params.rb
module MailParams
extend ActiveSupport::Concern
def mail_params
attachments = build_attachments
body = build_rich_body(attachments)
{ subject: mail.subject, body: body, attachments: attachments.map { |a| a[:blob] } }
end
@skratchdot
skratchdot / donate.md
Created January 25, 2016 17:42
My Paypal donate button in markdown format

Donation Button

Donate

@bsnape
bsnape / gist:edff869d5b7dc0b0d7c2
Last active August 29, 2023 05:15
Rubymine find & replace string hash rockets with new syntax
find:
\'(\w+)\'\s*=>
replace:
$1:
replace symbol hash rockets with new syntax
find:
@vitorbritto
vitorbritto / add_apache_brew.md
Last active March 4, 2019 10:30
Install Apache with Homebrew

Install Apache with Homebrew

Installing Apache

# Start by stopping the built-in Apache, if it's running, and prevent it from starting on boot.
# This is one of very few times you'll need to use sudo:
sudo launchctl unload /System/Library/LaunchDaemons/org.apache.httpd.plist 2>/dev/null

# We need to tap homebrew-dupes because "homebrew-apache/httpd22" relies on "homebrew-dupes/zlib"

and install Apache 2.2 with the event MPM, and we'll use Homebrew's OpenSSL library

@Marthyn
Marthyn / JqueryAjaxRequest.js
Last active December 15, 2015 04:58
Jquery Ajax Requests
var api = "yourApiUrlGoesHere";
/*
Method to do a GET request to the service
*/
var getService = function (uri, failureFunction, errorFunction, successFunction)
{
$.ajax({
cache: true,
url: api+uri,