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 'axlsx' | |
module Reports | |
class AxlsxReport < Reports::Report | |
##call from irb (or anything ruby for that matter) to generate report (i.e. Reports::AxlsxReport.generate) | |
def self.generate | |
Alsx::Package.new do |p| | |
p.workbook.add_worksheet(:name => 'Users') {|ws| users_worksheet(ws)} | |
p.workbook.add_worksheet(:name => 'User Groups') {|ws| user_groups_worksheet(ws)} |
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 'prawn' | |
module Reports | |
class PrawnReport < Reports::Report | |
#call this from irb or any ruby code for that matter (i.e. Reports::PrawnReport.generate) | |
def self.generate | |
Prawn::Document.generate('prawn.pdf') do |pdf| | |
report_header(pdf) | |
report_body(pdf) |
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
ENV["RAILS_ENV"] ||= 'test' | |
require 'spec_helper' | |
require File.expand_path("../../config/environment", __FILE__) | |
require 'rspec/rails' | |
require 'brakeman' | |
ActiveRecord::Migration.maintain_test_schema! | |
RSpec.configure do |config| | |
config.use_transactional_fixtures = true |
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 Archive < ActiveRecord::Base | |
#model will be read only! | |
def self.posts | |
Post.where('published = ? and published_date >= ? and published_date <= ?', true, Date.civil(a.year, a.month, 1), Date.civil(a.year, a.month, -1)) | |
end | |
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
<%= form_for @playlist do |f| %> | |
<%= f.text_field :name, placeholder: 'Name' %> | |
<%= f.text_area :description %> | |
<%= f.date_field :date_in %> | |
<%= f.date_field :date_out %> | |
<%= f.fields_for :media_files do |ff| %> | |
<%= ff.collection_select :media_file_id, MediaFile.all, :id, :name, {}, {} %> | |
<%= ff.select :position, options_for_select((1..50).step(1) {} | |
<%= ff.link_to_remove 'Remove from Playlist' %> | |
<% 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
packages: | |
- advanced-open-file | |
- color-picker | |
- emmet | |
- erb-helper | |
- file-icons | |
- filesize | |
- git-plus | |
- markdown-preview-plus | |
- minimap |
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
#!/bin/bash | |
# | |
# Copyright:: Copyright (c) 2015 Gitlab.com | |
# Copyright:: Copyright (c) 2016 Amusement SMART, LLC | |
# License:: Apache License, Version 2.0 | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# |
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 'delegate' | |
class ApplicationDecorator < SimpleDelegator | |
def self.decorate(instance) | |
return nil if instance.blank? | |
new instance | |
end | |
def self.decorate_collection(collection) | |
return [] if collection.nil? || collection.length.zero? |
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 NotificationType | |
attr_accessor :id, :load_id | |
def initialize(id, load_id) | |
self.id = id | |
self.load_id = load_id | |
check_valid_id | |
end | |
def description |
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
stages: | |
- test | |
- build | |
variables: | |
DB_HOST: postgres | |
DB_PASS: postgres | |
DB_USER: postgres | |
brakeman: |
OlderNewer