Skip to content

Instantly share code, notes, and snippets.

@maxivak
maxivak / 00.md
Last active April 8, 2025 18:31
Sending emails with ActionMailer and Sidekiq

Sending emails with ActionMailer and Sidekiq

Send email asynchroniously using Sidekiq.

ActionMailer

Create your mailer us usual:

@aesnyder
aesnyder / global-utc-angular.coffee
Last active September 8, 2016 16:37
Globally Configure Angular Date $filter to UTC
app.config ($provide) ->
$provide.decorator 'dateFilter', ($delegate) ->
(date, format, timezone) ->
$delegate.call this, date, format, if timezone then timezone else 'UTC'
@jvenator
jvenator / gist:9672772a631c117da151
Last active February 19, 2025 19:15
PDFtk Server Install Workaround for Mac OS X

Installing PDFtk Server edittion on your Mac

This workaround install is necessary because PDFtk was pulled from homebrew-cask due to issues with it aggressively overwriting file permissions that could impact other installed libraries. See this homebrew-cask issue.
The following steps worked on Mac OS X 10.10.1 with a standard brew installation for the PDFtk Mac OS X server libary version 2.02.
All Terminal commands separated by a full line space. Some commands wrap into multiple lines.

Download and extract the Mac OS X server install pacakge

@bobbygrace
bobbygrace / trello-css-guide.md
Last active December 10, 2024 21:04
Trello CSS Guide

Hello, visitors! If you want an updated version of this styleguide in repo form with tons of real-life examples… check out Trellisheets! https://github.com/trello/trellisheets


Trello CSS Guide

“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”

You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?

@djburdick
djburdick / rubocop_circleci.rb
Created November 11, 2014 20:18
Run rubocop with circleci
# In spec_helper.rb
RSpec.configure do |config|
....
rubocop_output = `rubocop`
print rubocop_output
fail "RuboCop Errors" unless rubocop_output.match(/files inspected, no offenses detected/)
end
@vijedi
vijedi / base_controller.rb
Created November 8, 2014 15:14
Pagination with angular-paginate-anything and kaminari
class Api::BaseController < ApplicationController
include Rivalry::OrganizationScope
respond_to :json
private
def self.paginated_action(options = {})
before_filter(options) do |controller|
if request.headers['Range-Unit'] == 'items' &&
request.headers['Range'].present?
@ngsmrk
ngsmrk / sidekiq_monitoring
Created August 11, 2014 11:51
Sidekiq queue checking via rails console
stats = Sidekiq::Stats.new
stats.queues
stats.enqueued
stats.processed
stats.failed
angular.module('ClientSuccess.services').factory 'fileService', (authService, $q, $rootScope)->
service = {}
service.uploadAvatar = (file) ->
deferred = $q.defer()
apiAuth = authService.enableAuth()
query =
binary: null
id: null
postIt = () ->
@staltz
staltz / introrx.md
Last active April 24, 2025 06:10
The introduction to Reactive Programming you've been missing
@stuartbates
stuartbates / PHPass
Created March 20, 2014 13:16
Ruby implementation of PHPass to allow legacy passwords from Wordpress to Devise
class PHPass
def self.itoa64
'./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
end
def self.crypt_private(password, setting)
output = '*0'
if setting[0,2] == output