Skip to content

Instantly share code, notes, and snippets.

View bmichotte's full-sized avatar

Benjamin Michotte bmichotte

View GitHub Profile
class ButtonCell < PM::CollectionViewCell
def setup(data_cell, _)
super.tap do
@imageview.image = data_cell[:image].uiimage if data_cell.has_key?(:image)
@label.text = data_cell[:title] if data_cell.has_key?(:title)
end
end
def on_created
class TestFormScreen < PM::FormScreen
title "PM::XLFormScreen"
form_options required: :asterisks,
# by default, button "title" is NSLocalizedString("Save")
on_save: :'save_form:',
# or
@bmichotte
bmichotte / style.css
Created July 7, 2015 12:23
page break to use with wkhtmltopdf
.page-breaker
{
display: block;
clear: both;
page-break-after: always;
}
@bmichotte
bmichotte / Gemfile
Last active August 29, 2015 14:24
crash
source 'https://rubygems.org'
gem 'rake'
gem 'motion-cocoapods'
gem 'redpotion'
gem 'cdq'
@bmichotte
bmichotte / gist:9cd0f7b9c2b6c1cf6bb6
Last active August 29, 2015 14:22
Motion-Kit UICollectionViewCell
class MyLayout < MK::Layout
def layout
super.tap do
collection_layout = UICollectionViewFlowLayout.new
collection_layout.scrollDirection = UICollectionViewScrollDirectionHorizontal
collection_layout.minimumLineSpacing = 0
collection_layout.minimumInteritemSpacing = 0
collection = UICollectionView.alloc.initWithFrame(CGRectZero, collectionViewLayout: collection_layout)