Collection of concerns for your Rails application
Copy to your app/models/concerns
directory
<textarea name="my-xml-editor" data-editor="xml" rows="15"></textarea> | |
... | |
<textarea name="my-markdown-editor" data-editor="markdown" rows="15"></textarea> | |
... | |
<script src="//d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js"></script> | |
<script> | |
// Hook up ACE editor to all textareas with data-editor attribute | |
$(function () { |
module Devise | |
module Strategies | |
class RemoteAuthenticatable < Authenticatable | |
# | |
# For an example check : https://github.com/plataformatec/devise/blob/master/lib/devise/strategies/database_authenticatable.rb | |
# | |
# Method called by warden to authenticate a resource. | |
# | |
def authenticate! | |
# |
# config/locales/en.yml | |
en: | |
exception: | |
show: | |
not_found: | |
title: "Not Found" | |
description: "The page you were looking for does not exists." | |
internal_server_error: | |
title: "Internal Server Error" |
require 'gollum/frontend/app' | |
require 'digest/sha1' | |
class App < Precious::App | |
User = Struct.new(:name, :email, :password_hash, :can_write) | |
before { authenticate! } | |
before /^\/(edit|create|delete|livepreview|revert)/ do authorize_write! ; end | |
helpers do |
# This file goes in config/initializers | |
require 'bootstrap_form_builder' | |
# Make this the default Form Builder. You can delete this if you don't want form_for to use | |
# the bootstrap form builder by default | |
ActionView::Base.default_form_builder = BootstrapFormBuilder::FormBuilder | |
# Add in our FormHelper methods, so you can use bootstrap_form_for. | |
ActionView::Base.send :include, BootstrapFormBuilder::FormHelper |
class Api::RegistrationsController < Api::BaseController | |
respond_to :json | |
def create | |
user = User.new(params[:user]) | |
if user.save | |
render :json=> user.as_json(:auth_token=>user.authentication_token, :email=>user.email), :status=>201 | |
return | |
else |
"Color:Background" = "rgb(11051,11051,11051)"; | |
"Color:Background:Grep Replace Pattern" = "rgb(62915,62915,62915)"; | |
"Color:Background:Grep Search Pattern" = "rgb(62915,62915,62915)"; | |
"Color:CTagsIdentifier" = "rgb(48776,20456,15006)"; | |
"Color:ColorAttributesSeparately" = 1; | |
"Color:Comment" = "rgb(26214,26214,26214)"; | |
"Color:Comment:Markdown" = "rgb(43036,43036,43036)"; | |
"Color:Foreground" = "rgb(59110,57825,56540)"; | |
"Color:Foreground:Grep Replace Pattern" = "rgb(0,0,0)"; | |
"Color:Foreground:Grep Search Pattern" = "rgb(0,0,0)"; |
#MySQL Client | |
ln -s /Application/MySQL\ Workbench.app/Contents/Resources/mysql /usr/bin/mysql | |
#MySQL Dump | |
ln -s /Application/MySQL\ Workbench.app/Contents/Resources/mysqldump /usr/bin/mysqldump |