Skip to content

Instantly share code, notes, and snippets.


Ambas Chobsanti ambas

View GitHub Profile
View CartWithIGListKit.markdown
  • Start with Classes -> Modules -> Cart -> Section

  • In this folder you can see all section type that we have in cart. ( PS. LACartSection is legacy class)

  • I use IGListBindingSectionController for SectionController with this way it will automatically bind viewModel and cell for us.

  • in sectionController class, we have to implement some dataSource methods

    • First we need to return all viewModel for section
    • Each viewModel will map to cell so relationship for viewModel and cell will be 1 to 1. So its mean a viewModel will have a cell to show.
    • I use category to separate logic for build viewModels , for the final result we will return array of viewModel to IGListKit and all of this viewModel will be mapped to cell.
    • You can check category in folder Classes -> Modules -> Cart -> Categories
    • If you start reading code at sectionController you will see category of viewModel try to ask a list of viewModel from child viewModel . I use this way because I try to separate viewModel bui
View DictionaryDeepMerge.swift
extension Dictionary {
mutating func merge<S>(_ other: S) where S: Sequence, S.Iterator.Element == (key: Key, value: Value) {
for (k, v) in other {
let old = self[k]
self[k] = merge(old, r: v)
extension Dictionary {
ambas / gist:dd5240e3b843d6608990
Last active Aug 29, 2015
FetechedResultsController for TableView
View gist:dd5240e3b843d6608990
- (void)controllerWillChangeContent {
[self.tableView beginUpdates];
- (void)controllerDidChangeSection:(RBQFetchedResultsSectionInfo *)section atIndex:(NSUInteger)sectionIndex forChangeType:(NSFetchedResultsChangeType)type {
switch (type) {
case NSFetchedResultsChangeInsert:
[self.insertSections addObject:@(sectionIndex)];
case NSFetchedResultsChangeDelete:
View MySed
sed -i '' 's/nullable//g' $(grep -lr --exclude-dir=".git" -e "nullable" .)
View Sed
sed -i '' 's/nullable//g' $(grep -lr --exclude-dir=".git" -e "nullable" .)
View -
View -
This is Brazil
We couldn’t find that file to show.
ambas / public key
Last active Nov 14, 2017
for generate public key
View public key
ssh-keygen -t rsa -C "" && pbcopy < ~/.ssh/