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
require 'csv' | |
class Exporter | |
DEFAULT_EXPORT_TABLES = [ Invoice, InvoiceItem, Item, Merchant, Transaction, User ] | |
DESTINATION_FOLDER = "tmp/" | |
def self.export_tables_to_csv(tables = DEFAULT_EXPORT_TABLES) | |
tables.each { |klass| export_table_to_csv(klass) } | |
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 ApplicationController < ActionController::Base | |
extend AttributeViewable | |
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
<!-- path: app/views/refinery/admin/pages/_actions.html.erb --> | |
<!-- | |
You could override this view, if you want to add links to each page type via the admin UI. If you don't you'll have to add a param the the URL. | |
WARNING: You most probably want to do it cleaner than that and find a way to hook to this view instead of overriding it if at all possible. | |
--> | |
<ul> | |
<li> | |
<%= render '/refinery/admin/search', :url => refinery.admin_pages_path %> | |
</li> |
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
git rev-parse HEAD | tr -d '\n' | pbcopy |
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
get '/travis/:id/status' do |id| | |
token = "token!!" | |
http = Net::HTTP.new('magnum.travis-ci.com', 443) | |
http.use_ssl = true | |
path = "/Readmill/#{id}.png?token=#{token}" | |
response = http.head(path, nil) | |
if response['Content-Disposition'].include?('failing') | |
@message = "The build failed." |
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
# config/initializers/tumbz_init.rb | |
Tumbz.configure do |config| | |
config.access_key = "foo" | |
config.access_secret = "bar" | |
end | |
# lib/tumbz.rb | |
module Tumbz | |
def self.configure | |
@options = OpenStruct.new |
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 | |
git checkout master | |
git pull | |
git branch --remotes --merged | grep origin > .master_merged | |
git checkout release-staging | |
git pull | |
git branch --remotes --merged | grep origin > .staging_merged | |
diff .master_merged .staging_merged | |
rm .master_merged .staging_merged |
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
### spec/serializers/building_spec.rb | |
require "spec_helper" | |
describe BuildingSerializer do | |
include Rails.application.routes.url_helpers | |
let(:room) { create :room } | |
let(:building) { room.building } | |
let(:hash) { BuildingSerializer.new(building).serializable_hash } |
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
require 'java' | |
require 'JLink.jar' | |
# Java::ComWolframJlink::KernelLink | |
# http://reference.wolfram.com/mathematica/JLink/ref/java/com/wolfram/jlink/KernelLink.html | |
# http://reference.wolfram.com/mathematica/JLink/ref/java/com/wolfram/jlink/MathLink.html | |
# Java::ComWolframJlink::MathLinkException | |
# Java::ComWolframJlink::MathLinkFactory | |
# http://reference.wolfram.com/mathematica/JLink/ref/java/com/wolfram/jlink/MathLinkFactory.html |
OlderNewer