Skip to content

Instantly share code, notes, and snippets.

View vzaremba's full-sized avatar

Viktor Zaremba vzaremba

View GitHub Profile
@vzaremba
vzaremba / freeform_responsive_table_example.html
Created January 19, 2017 12:45
Freeform Widget responsive table example
<table class="responsive">
<tr>
<th>Header 1</th>
<th>Header 2</th>
<th>Header 3</th>
<th>Header 4</th>
<th>Header 5</th>
<th>Header 6</th>
<th>Header 7</th>
<th>Header 8</th>
@vzaremba
vzaremba / freeform_table_example.html
Last active January 19, 2017 12:45
Freeform Widget table example
<table style="width: 100%;">
<tbody>
<tr>
<td width="25%" rowspan="2" class="centered-text">
<img width="204" height="141" src="https://searshomewarranty.com/Templates/ion/ion_Framework_v4.0/themes/sears/logo_searshomewarranty_1608_resized.png">
</td>
<td width="25%" class="teal-bg centered-text">
<a class="white-text big-text" href="https://www.google.com">Whole House Warranty</a><br>
<a class="white-text small-text" href="https://www.google.com">Best Value!</a>
</td>
private def period_cond(t_alias = 'f', t_column = 'created_at')
beginning_date, end_date =
case options.period
when 'this_week'
[Date.current.beginning_of_week.to_date, Date.current.to_date]
when 'this_month'
[Date.current.beginning_of_month.to_date, Date.current.to_date]
when 'this_quarter'
[Date.current.beginning_of_quarter.to_date, Date.current.to_date]
when 'this_year'
@vzaremba
vzaremba / cb_dpi_test.xml
Last active January 17, 2018 05:44
CB DPI Test
I'm using SOAP.
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ProcessJob xmlns="http://dpi.careerbuilder.com/WebServices/RealTimeJobPost">
<xmlJob>
<Job>
<Field name="CBVendorID" value="AB6YR5WGJRL5F0814V"/>
<Field name="CBAction" value="ADD"/>
@vzaremba
vzaremba / js
Created November 13, 2013 10:26
$(function(){
var $all = $('#selectAllButton input[type="radio"]').change(function () {
$sectionchecks.prop('checked', true).trigger('change');
$none.closest('label').removeClass('c_on');
});
var $none = $('#selectNoneButton input[type="radio"]').change(function () {
$sectionchecks.prop('checked', false).trigger('change');
$all.closest('label').removeClass('c_on');
});
@vzaremba
vzaremba / has_many_through.rb
Last active December 23, 2015 00:09
Rails - filter using join model on has_many through.
class Person
has_many :accounts
has_many :computers, through: :accounts
end
class Account
belongs_to :person
belongs_to :computer
scope :administrators, -> { where(role: 'administrator') }
require 'ostruct'
class LastPayReport
def initialize employees
@employees = employees
end
def get_rows
rows = []