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
| Open-Mastery Todo List: | |
| - Update to rails 3.2.1 | |
| - Make it searchable. @priority(1) | |
| this ones going to take some research | |
| - Give it a sitemap @priority(3) | |
| - Write some how-to's @priority(1) | |
| - Make the system smarter to support sub-folders/groups @priority(4) | |
| - Make it super pretty @priority(5) | |
| - Add Comments via Disqus @priority(3) |
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
| def super_random | |
| rand(1..1000000) | |
| rand(1..1000000) | |
| rand(1..5) | |
| end | |
| case super_random | |
| when 1 | |
| puts "You are staying in construction" | |
| when 2 |
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
| - flash.each do |name, msg| | |
| .alert-message{:class => "#{name.to_s} fade in", "data-alert" => "alert"} | |
| %a.close{:href => "#"} × | |
| %p | |
| = msg |
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
| - flash.each do |name, msg| | |
| .alert{:class => "alert-#{name.to_s} fade in", "data-alert" => "alert"} | |
| %a.close{:href => "#"} × | |
| %p | |
| = msg |
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 ApplicationController < ActionController::Base | |
| protect_from_forgery | |
| before_filter :start_logging | |
| after_filter :complete_logging | |
| def after_sign_in_path_for(resource) | |
| root_url(:subdomain => resource.slug) | |
| end | |
| rescue_from CanCan::AccessDenied do |exception| |
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
| AquaLogger: | |
| - Splash page with sign-up @priority(1) | |
| - Beta invite system @priority(1) | |
| - Add Tanks @priority(2) | |
| - Add Parameters (Belongs to tanks) @priority(2) |
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 Feed < ActiveRecord::Base | |
| validates :uri, presence: true, | |
| format: { with: /(^$)|([a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(([0-9]{1,5})?\/.*)?$)/ix } | |
| def load_feed | |
| @cache ||= Redis.new | |
| if @cache.exists("Feed:#{self.uri}") | |
| return Feedzirra::Feed.parse(@cache.get "Feed:#{self.uri}") | |
| else |
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
| before_create :set_new_user_role | |
| def set_new_user_role | |
| if user is first user | |
| then user.role = admin_role_id | |
| user.save | |
| else | |
| user.role = default_role_id | |
| user.save | |
| 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
| #!/usr/bin/env ruby | |
| # Convert strings into binary! | |
| # save as binary (without .rb) | |
| # Usage ./binary string to be converted to binary (quotes not required) | |
| class String | |
| def to_binary | |
| binary = "" |
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 'typhoeus' | |
| require 'json' | |
| module Gitlax | |
| class User | |
| attr_accessor :user_login, :profile | |
| def initialize(options = {}) | |
| @user_login = options[:login] || nil |