This file contains 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 AddFieldsToDelayedJobs < ActiveRecord::Migration | |
def change | |
add_column :delayed_jobs, :signature, :string | |
add_index :delayed_jobs, :signature | |
end | |
end |
This file contains 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
# Extend in your test_helper.rb or any other `/support` setup you have. | |
class ActiveSupport::TestCase | |
# === NOTICE: | |
# Ensure you have included `ActionMailer::TestHelper` in the test class .. | |
# | |
# This method performs any enqueued job during tests manually, | |
# Helpful when testing the queueing of your jobs and then the result of their execution. | |
# | |
# === Author: (abarrak, danielpuglisi) |
This file contains 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
module StaticMapHelper | |
def static_map_for(location, options = {}) | |
params = { | |
center: [location.latitude, location.longitude].join(","), | |
zoom: 15, | |
size: "300x300", | |
scale: 2, | |
markers: [location.latitude, location.longitude].join(","), | |
sensor: true, |
This file contains 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
$ -> | |
$(document).on("page:change", -> | |
sumo = document.createElement("script") | |
sumo.type = "text/javascript" | |
sumo.async = true | |
sumo.src = "//load.sumome.com/" | |
sumo.setAttribute('data-sumo-site-id', 'your sumo me ID') | |
(document.getElementsByTagName("head")[0] or document.getElementsByTagName("body")[0]).appendChild(sumo) | |
) |
This file contains 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
#!/bin/bash | |
# | |
# Fix postgres after OSX crashed | |
pg_resetxlog /usr/local/var/postgres | |
rm /usr/local/var/postgres/postmaster.pid | |
pg_resetxlog /usr/local/var/postgres | |
pg_resetxlog -f /usr/local/var/postgres | |
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start |
This file contains 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
# Variant 1 | |
def user_params(type) | |
params.require(type.to_sym).permit(attributes) | |
end | |
# Variant 2 | |
def user_params(type) | |
case type | |
when "user" | |
params.require(:user).permit(user_attributes) |
This file contains 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
# bring up the vagrant VM | |
sudo apt-get install vagrant | |
git clone https://bitbucket.org/puffnfresh/vagrant-haskell-heroku.git | |
cd vagrant-haskell-heroku | |
vagrant up | |
vagrant ssh | |
# run this in vagrant shell | |
cabal update | |
cabal install cabal-install |
This file contains 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
# other stuff | |
config/env.rb | |
# other stuff |
This file contains 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
module Seiten | |
module Controllers | |
# Those helpers are convenience methods added to ApplicationController. | |
module Helpers | |
extend ActiveSupport::Concern | |
def current_page | |
@current_page ||= Seiten::Page.find_by_slug(request.fullpath) | |
end | |
end |
This file contains 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
RSpec.configure do |config| | |
config.before(:all) do | |
FactoryGirl.reload | |
end | |
end |
NewerOlder