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 ApplicationHelper | |
# Basic function with this if you have any object.errors that you wanted formated you just call this method and it will handle the formating | |
def error_summery( object ) | |
return unless object.errors.any? | |
# Build the messages li | |
messages = [] | |
object.errors.full_messages.each do |msg| | |
messages << content_tag(:li, msg) | |
end | |
content_tag(:div, "Please review the errors below", class: 'alert alert-danger') + |
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 | |
cd ~/starbound/linux64 | |
./starbound_server |
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 | |
read -p "Enter Username: " username | |
~/steamcmd/steamcmd.sh +login $username +force_install_dir ~/starbound +app_update 211820 +quit |
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
@font-face { | |
font-family: 'Glyphicons Halflings'; | |
src: url(if($bootstrap-sass-asset-helper, twbs-font-path('#{$icon-font-path}#{$icon-font-name}.eot'), '#{$icon-font-path}#{$icon-font-name}.eot')); | |
src: url(if($bootstrap-sass-asset-helper, twbs-font-path('#{$icon-font-path}#{$icon-font-name}.eot?#iefix'), '#{$icon-font-path}#{$icon-font-name}.eot?#iefix')) format('embedded-opentype'), | |
url(if($bootstrap-sass-asset-helper, twbs-font-path('#{$icon-font-path}#{$icon-font-name}.woff2'), '#{$icon-font-path}#{$icon-font-name}.woff2')) format('woff2'), | |
url(if($bootstrap-sass-asset-helper, twbs-font-path('#{$icon-font-path}#{$icon-font-name}.woff'), '#{$icon-font-path}#{$icon-font-name}.woff')) format('woff'), | |
url(if($bootstrap-sass-asset-helper, twbs-font-path('#{$icon-font-path}#{$icon-font-name}.ttf'), '#{$icon-font-path}#{$icon-font-name}.ttf')) format('truetype'), | |
url(if($bootstrap-sass-asset-helper, twbs-font-path('#{$icon-font-path}#{$icon-font-name}.svg##{$icon-font-svg-id}'), |
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 ApplicationController < ActionController::Base | |
before_filter :set_current_user | |
protected | |
def set_current_user | |
# Call in model with User.current_user | |
User.current_user = self.current_user | |
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
class ErrorFormBuilder < ActionView::Helpers::FormBuilder | |
#Adds error message directly inline to a form label | |
#Accepts all the options normall passed to form.label as well as: | |
# :hide_errors - true if you don't want errors displayed on this label | |
# :additional_text - Will add additional text after the error message or after the label if no errors | |
def label(method, text = nil, options = {}) | |
#Check to see if text for this label has been supplied and humanize the field name if not. | |
text = text || method.to_s.humanize | |
#Get a reference to the model object | |
object = @template.instance_variable_get("@#{@object_name}") |
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
# Filters added to this controller apply to all controllers in the application. | |
# Likewise, all the methods added will be available for all controllers. | |
# Make sure that all the methods that redirect are handled in the controllers. | |
class ApplicationController < ActionController::Base | |
include AuthenticatedSystem | |
include Userstamp | |
include ExceptionLoggable | |
local_addresses.clear |
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
namespace :images do | |
require 'action_controller' | |
require 'action_controller/test_process.rb' | |
require 'find' | |
desc "Imports all the images into the database as well as formats the for your use." | |
task :import => :environment do | |
cards = Array.new | |
Card.find(:all).map do |t| | |
cards << ["#{t.name}"] |
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 ApplicationHelper | |
# A nice way to help the views tell if you are on the current page you want to be on. | |
def current_view(params, options = {}) | |
results = options[:result] || "true" | |
valid = true | |
options.each do |option| | |
for param in params |
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
# encoding: utf-8 | |
class PhotoUploader < CarrierWave::Uploader::Base | |
# Include RMagick or ImageScience support: | |
include CarrierWave::RMagick | |
# include CarrierWave::ImageScience | |
# Choose what kind of storage to use for this uploader: | |
if RAILS_ENV == "development" | |
storage :file |
OlderNewer