Skip to content

Instantly share code, notes, and snippets.

View bmichotte's full-sized avatar

Benjamin Michotte bmichotte

View GitHub Profile
@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)
@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 / style.css
Created July 7, 2015 12:23
page break to use with wkhtmltopdf
.page-breaker
{
display: block;
clear: both;
page-break-after: always;
}
class TestFormScreen < PM::FormScreen
title "PM::XLFormScreen"
form_options required: :asterisks,
# by default, button "title" is NSLocalizedString("Save")
on_save: :'save_form:',
# or
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 MyXLFormScreen < PM::XLFormScreen
def form_data
[
{
cells: [
{
title: 'my textview',
name: :my_textview,
type: :textview,
cell_class: 'MyXLFormTextViewCell'
@bmichotte
bmichotte / # mysql - 2016-04-06_10-22-29.txt
Last active April 8, 2016 15:23
mysql on Mac OS X 10.11.4 - Homebrew build logs
Homebrew build logs for mysql on Mac OS X 10.11.4
Build date: 2016-04-06 10:22:29
Thread 0 Crashed:
0 HSTracker 0x00000001054173a9 function signature specialization <Arg[0] = Owned To Guaranteed, Arg[1] = Dead and Owned To Guaranteed> of HSTracker.DeckManager.tableView (__ObjC.NSTableView, viewForTableColumn : __ObjC.NSTableColumn?, row : Swift.Int)__ObjC.NSView? (DeckManager.swift:0)
1 HSTracker 0x00000001054120ad @objc HSTracker.DeckManager.tableView (__ObjC.NSTableView, viewForTableColumn : __ObjC.NSTableColumn?, row : Swift.Int)__ObjC.NSView? (DeckManager.swift:0)
2 AppKit 0x00007fff8a2a28e0 -[NSTableView(NSTableViewViewBased) makeViewForTableColumn:row:] + 75
3 AppKit 0x00007fff8a2a1c44 -[NSTableRowData _addViewToRowView:atColumn:row:] + 299
4 AppKit 0x00007fff8a2a198d -[NSTableRowData _addViewsToRowView:atRow:] + 183
5 AppKit 0x00007fff8aa02d8b -[NSTableRowData _initializeRowView:atRow:] + 372
6 App
@bmichotte
bmichotte / !NOTE.md
Created August 24, 2017 14:55 — forked from ivanvermeyen/!NOTE.md
Setup a Laravel Storage driver with Google Drive API
struct A { let a: String }
let array = [A(a: "b"), A(a: "C"), A(a: "b")]
let dictionary = Dictionary(grouping: array) { $0.a }
dictionary
extension Array {
func group<K: Hashable, Element>(_ fn: (Element) -> K) -> Dictionary<K, [Element]> {
return Dictionary<K, [Element]>(grouping: self, by: fn)
}
}