Skip to content

Instantly share code, notes, and snippets.

@dustMason
dustMason / deps.sh
Last active January 11, 2022 15:51 — forked from prashantmaurice/install-ffmpeg-amazon-linux.sh
How to compile ffmpeg on Amazon Linux (EC2) for use on AWS Lambda
#!/bin/bash
# Author : Hemanth.HM
# Email : hemanth[dot]hm[at]gmail[dot]com
# License : GNU GPLv3
#
function useage()
{
cat << EOU
Useage: bash $0 <path to the binary> <path to copy the dependencies>
@dustMason
dustMason / money.rb
Last active January 13, 2017 01:39 — forked from dkubb/money.rb
A modern ruby Money class, for ActiveShipping?
require 'bigdecimal'
module ActiveShipping #:nodoc:
class Money
SCALE = 2
OPERAND_CLASSES = [self, Rational, BigDecimal, Integer].freeze
attr_reader :amount
protected :amount
@dustMason
dustMason / application.rb
Last active December 18, 2015 17:19 — forked from t2/application.rb
Rails 3 ActionView override for Foundation 4 field error styles.
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
html = %(<div class="error">#{html_tag})
html += %(<small>#{instance.error_message.to_a.to_sentence}</small>).html_safe unless html_tag =~ /^<label/
html += %(</div>)
html.html_safe
end
@dustMason
dustMason / index.js.erb
Created December 17, 2011 04:16 — forked from ryanb/index.js.erb
Infinite scrolling solution covered in revised episode #114: http://railscasts.com/episodes/114-endless-page-revised
$('#products').append('<%= j render(@products) %>');
<% if @products.next_page %>
$('.pagination').replaceWith('<%= j will_paginate(@products) %>');
<% else %>
$('.pagination').remove();
<% end %>