Send email asynchroniously using Sidekiq.
Create your mailer us usual:
require "open-uri" | |
require "net/http" | |
Error = Class.new(StandardError) | |
DOWNLOAD_ERRORS = [ | |
SocketError, | |
OpenURI::HTTPError, | |
RuntimeError, | |
URI::InvalidURIError, |
// set svg d path used as fallback (star) | |
$svg-d-path: 'm25,1l6,17l18,0l-14,11l5,17l-15,-10l-15,10l5,-17l-14,-11l18,0l6,-17z' !default; | |
// functions to urlencode the svg string | |
@function str-replace($string, $search, $replace: '') { | |
$index: str-index($string, $search); | |
@if $index { | |
@return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace); | |
} | |
@return $string; |
.super-fly-list-component .measure { | |
position: absolute; | |
left: -9999px; | |
} | |
.super-fly-list-component { | |
position: relative; | |
} | |
.super-fly-list-component li { | |
position: absolute; | |
transition: opacity .3s ease, transform .3s ease, top .1s ease; |
# === EDITOR === | |
Pry.editor = 'vi' | |
require 'awesome_print' | |
# == Pry-Nav - Using pry as a debugger == | |
Pry.commands.alias_command 'c', 'continue' rescue nil | |
Pry.commands.alias_command 's', 'step' rescue nil | |
Pry.commands.alias_command 'n', 'next' rescue nil | |
# === CUSTOM PROMPT === |
So you want to have pretty URLs with no trailing slash or .html
like:
http://mysite.com/blog/my-new-kitten
not like:
http://mysite.com/blog/my-new-kitten/
or
# I used https://github.com/eliotsykes/rack-zippy to serve gzipped static assets. | |
# By default the rails asset pipeline was not compressing any static svg files, | |
# so I did the following to achive that. | |
# | |
# First create a rake task that will fine and compress svg files. | |
# File: lib/tasks/assets_svg_compress.rake | |
namespace :assets do | |
task :svg_compress => :environment do | |
svg_files = Dir["./public/**/*.svg"] | |
svg_files.each do |file| |
var React = require('react/addons'); | |
var Table = require('./table.jsx'); | |
var rows = [ | |
{ | |
'id' : 1, | |
'foo': 'bar' | |
}, | |
{ | |
'id' : 2, | |
'foo': 'baarrrr' |
let csrfToken = 'lololololol'; | |
let axiosDefaults = require('axios/lib/defaults'); | |
axiosDefaults.headers.common['X-CSRF-Token'] = csrfToken; |