Skip to content

Instantly share code, notes, and snippets.

View 8vius's full-sized avatar

Luis Miguel Delgado 8vius

View GitHub Profile
function ps1_powerline {
RETCODE=$? # save return code
NUM_JOBS=$(jobs -rp | wc -l)
GIT_BRANCH=$(__git_ps1)
RUBY=$(prompt_rvm)
# local GREY="\[\e[48;5;240m\]\[\e[38;5;250m\]"
# local GREY_END="\[\e[48;5;2m\]\[\e[38;5;240m\]"
local GREEN="\[\e[48;5;2m\]\[\e[38;5;255m\]"
class PdfController < ActionController::Base
include PdfGeneration
expose :report
def self.draw_report(draw)
run { build_draw_report(draw) }
end
def self.portfolio_report(portfolio)
class PdfController < ActionController::Base
include PdfGeneration
expose :report
def self.draw_report(draw)
run { build_draw_report(draw) }
end
def self.portfolio_report(portfolio)
module PdfGeneration
def pdf_options(report)
{
pdf: "report",
layout: "report_pdf",
template: "reports/show",
orientation: "Landscape",
page_size: "Letter",
print_media_type: true,
%h5 INVOICE REGISTER
%table.report.unlined(style="font-size: 7pt; margin-bottom: 0")
%thead
%tr.bb-1(style="page-break-inside: avoid;")
%th.text-center(style="width:2% !important") No.
%th.text-center(style="width:18% !important") Vendor
%th.text-center(style="width:15% !important") Invoice Number
%th.text-center(style="width:13% !important") Invoice Date
%th.text-center(style="width:12% !important") Payment Status
@8vius
8vius / portfolio_cost_report.haml
Created September 3, 2018 16:28
Cost Report view
%h5 PORTFOLIO COST REPORT
%table.report
%thead.print
.nobreak
%tr
%th(colspan=2 style="text-align: left; width:16% !important") Project&nbsp;Name
%th
Baseline Budget
%th
/* global $ */
'use strict'
import React, {Component} from 'react'
import {connect} from 'react-redux'
import ReactDOM from 'react-dom'
import {findDOMNode} from 'react-dom'
import {Modal, ModalHeader, ModalBody, ModalFooter, Collapse, Button, FormGroup, FormText, Label, Input} from 'reactstrap'
import {assign} from 'lodash'
<script src="https://checkout.stripe.com/checkout.js"></script>
<a id="customButton" class="btn btn-lg btn-success mb-4">Donate</a>
<script defer="defer">
$(function() {
$('#new_donation').parsley();
$('#donation_amount').on('keypress', function() {
$(this).parsley().removeError("min", {updateClass: true});
charge = Stripe::Charge.create(
{
source: donation.stripeToken,
amount: donation.amount_cents,
description: 'Piggybackr v2',
currency: donation.amount_currency,
statement_descriptor: statement_descriptor,
destination: {
amount: donation.amount_cents - donation.site_fee_cents,
account: fundraiser.owner.stripe_user_id
class Foo(object):
def method(param):
class Bar(object):
def method(param):
Foo().method(param)