This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@session.configure do |c| | |
c.svg_source = "template.svg" | |
c.svg_merged_target = "merged-template.svg" | |
c.png_export_width = 825 | |
c.pdf_dpi = 300 | |
c.pdf_card_size = "750x1050" | |
c.individual_files_path = "svgout/output_%03d.svg" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SearchController < ApplicationController | |
def index | |
@search = MultiSearch.new(params[:query]) | |
# ... do things to @search maybe ... | |
# ... or hand it off to a decorator ... | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# your source PNG files are in the input directory | |
mkdir -p output | |
for file in input/*.png; do | |
filename=${file##*/} | |
convert "${file}" -level "0%,100%,1.5" "output/${filename}" | |
# what the heck, make them smaller, too |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(-> | |
# set up or retrieve our local storage | |
navStatus = $.totalStorage('left_nav') || {} | |
# set up the initial state of each site opener and nav links | |
for id, status of navStatus | |
siteLink = $("#user_sites [data-id='#{id}']") | |
opener = siteLink.prev() | |
opener.toggleClass('open', status) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'quick_magick' | |
class CardsBuilder < Thor | |
no_tasks do | |
def bordersize(image, color = image.get_pixel(0, 0)) | |
image.gravity = 'center' | |
image.background = "rgb(#{color.join(',')})" | |
image.extent "825x1125" | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CARD_INFO = { | |
animal: { color: '#aa0000', border: '#ff0000' }, | |
vegetable: { color: '#00aa00', border: '#00ff00' }, | |
mineral: { color: '#0000aa', border: '#0000ff' } | |
}.freeze | |
# install this as a standalone gem | |
# or use a Gemfile and bundle exec with this script | |
require 'google_drive' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LIVERELOAD_PORT = 50000 | |
app = Rack::LiveReload.new( | |
lambda { |env| | |
[ | |
200, | |
{ 'Content-Type' => 'text/html' }, | |
[ <<-HTML ] | |
<html> | |
<head> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CARD_INFO = { | |
animal: { color: '#aa0000', border: '#ff0000' }, | |
vegetable: { color: '#00aa00', border: '#00ff00' }, | |
mineral: { color: '#0000aa', border: '#0000ff' } | |
}.freeze | |
data = [ | |
{ name: 'Cat', value: '1', type: :animal }, | |
{ name: 'Rutabaga', value: '2', type: :vegetable }, | |
{ name: 'Obsidian', value: '3', type: :mineral } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Put this in features/support/hooks.rb and add i18n-missing_translations and i18n_yaml_sorter to your Gemfile | |
require 'i18n/missing_translations' | |
require 'i18n_yaml_sorter' | |
at_exit do | |
require 'yaml' | |
data = YAML.load_file('config/locales/en.yml') | |
data.deep_merge!(I18n.missing_translations) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body.active_admin { | |
.cke { | |
display: inline-block; | |
table { width: auto; } | |
width: 78%; | |
} | |
.cke_button_label { |