Skip to content

Instantly share code, notes, and snippets.

@slowjack2k
slowjack2k / bank_statement_pdf_parser.js
Last active May 12, 2018 11:43
Quick & Dirty example of parsing a bank statement pdf (of a german bank) and converting it to csv
const getCategory = function(addresseeClient, eventReference, postingText){
if (/Auszahlung|Geldautomat|GAA /i.test(addresseeClient)){
return "cash";
}
return "none";
}
pdfs.forEach( function (pdfFilename) {
module BaseEntity
extend ActiveSupport::Concern
include ActiveModel::Model
include ActiveModel::Dirty
include ActiveModel::Serializers::JSON
include ActiveModel::Serializers::Xml
included do
include ::Virtus.model
@slowjack2k
slowjack2k / template.rb
Created April 4, 2014 11:07
Simple template for a new Rails-App using some nice extra gems. Call with: rails new app_name --skip-test-unit -m template.rb
def after_bundler_callbacks
@after_bundler_callbacks ||= []
end
def run_bundle
super
run_after_bundler_callbacks unless options[:skip_gemfile] || options[:skip_bundle]
end
def run_after_bundler_callbacks
@slowjack2k
slowjack2k / shared_group.rb
Created January 8, 2014 16:11
rspec shared groups using shared groups
require 'shared_group_2'
shared_examples "success example" do
it_behaves_like "failing example"
it "success" do
expect(true).to be_true
end
end