Skip to content

Instantly share code, notes, and snippets.

View brand-it's full-sized avatar

Brandt Lareau brand-it

View GitHub Profile
@brand-it
brand-it / cart.rb
Created November 28, 2012 23:25
PayPal Cart
class Cart < ActiveRecord::Base
scope :find_standard_subscription_purchased, where("line_items.product_name = ? AND purchased = ?", "Standard Subscription", true).includes(:line_items)
belongs_to :user
has_many :line_items
has_many :payment_notification
def total_price
@brand-it
brand-it / config.py
Last active December 11, 2015 16:58
Config.py file that is used for mincraftoverviewer
# This is a sample config file, meant to give you an idea of how to format your
# config file and what's possible.
# Define the path to your world here. 'My World' in this case will show up as
# the world name on the map interface. If you change it, be sure to also change
# the referenced world names in the render definitions below.
worlds['North'] = "~/maps/world"
worlds['East'] = "~/maps/world"
@brand-it
brand-it / assetmanager.py
Created January 25, 2013 03:33
asset manager I modified from the overviewer
# This file is part of the Minecraft Overviewer.
#
# Minecraft Overviewer is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published
# by the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
#
# Minecraft Overviewer is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
@brand-it
brand-it / mistakes.c
Created March 17, 2013 18:15
Common mistakes with C
int count;
while(count<100)
{
cout<<count;
}
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 formatted_errors(object = nil)
if object && object.errors.any?
return content_tag(:div, class: "ui_flash ui-widget ui-helper-clearfix", id: "error-messages") do
content_tag(:div, class: "ui-corner-all ui-state-error") do
content_tag(:span, "", class: "ui-icon ui-icon-left ui-icon-alert") +
content_tag(:span, "You have a total of " + pluralize(object.errors.count, "error") + " on this form") +
content_tag(:ul) do
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') +
@brand-it
brand-it / install_steam_starbound.sh
Last active May 8, 2016 00:11
Install Steam and starbound
#!/bin/bash --login
read -p "Enter Username: " username
read -s -p "Enter Password: " password
sudo apt-get update
sudo apt-get install lib32gcc1
sudo apt-get install libpng12-0
adduser steam
#!/bin/bash
cd ~/starbound/linux64
./starbound_server
#!/bin/bash
read -p "Enter Username: " username
~/steamcmd/steamcmd.sh +login $username +force_install_dir ~/starbound +app_update 211820 +quit
@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}'),