Skip to content

Instantly share code, notes, and snippets.

Giovanni Lodi mokagio

Block or report user

Report or block mokagio

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mokagio
mokagio / md_footnotes.md
Last active Sep 16, 2019
Markdown Footnote
View md_footnotes.md
Lorem ipsum dolor sit amet, consectetur adipiscing elit[<sup id="footnote-id">1</sup>](#fn1).

### Footnotes
1. <span id="fn1"></span> [_consectetur adipiscing elit_](#footnote-id). Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Example

@mokagio
mokagio / tables.md
Last active Feb 14, 2019
How to do tables in GitHub flavoured Markdown
View tables.md

This:

heading 1 | heading 2 | heading 3
--- | --- | ---
abc | bcd | cde
def | efg | fgh

becomes this:

@mokagio
mokagio / Good.md
Created Jan 16, 2019
Companies doing Good Stuff
View Good.md
  • Neybox health tracking apps
  • Stile give teachers tools to teach better STEMs
  • Chargefox help locate charge stations for electric cars
View Gmail_Web_Keyboard_Shortcuts.md
Action Shortcut
Add a Cc ⇧⌘c
Mark as unread ⇧u
Undo z
@mokagio
mokagio / SimpleDataSource.swift
Created May 18, 2018
Ready made `UITableViewDataSource` for those simple scenarios in which you want to display homogeneous data, of type `T`, in a single section, on a standard `UITableViewCell`
View SimpleDataSource.swift
// swift version 4.1
import UIKit
/// Ready made `UITableViewDataSource` for those simple scenarios in which you want to display
/// homogeneous data, of type `T`, in a single section, on a standard `UITableViewCell`.
class SimpleDataSource<T>: NSObject, UITableViewDataSource {
typealias Item = T
let data: [T]
@mokagio
mokagio / sort-tests.rb
Created Nov 28, 2017
Script used to get the slowest tests from Xcode as part of the Code Quality Challenge
View sort-tests.rb
# Run your tests in Xcode, copy the result in the console in a file, the run
#
# cat your_file | ruby sort-tests.rb
report = ARGF.read
times = report.lines
.select { |l| l.match(/Test Case .* \((\d*\.\d*) seconds\)/).nil? == false }
.map do |m|
{
@mokagio
mokagio / bootstrap
Created Nov 22, 2017
CQC day 8 bootstrap script
View bootstrap
#!/bin/bash
#
# Setup your local copy of the app. Run this script immediately after cloning
# the codebase.
#
set -eo pipefail
# First ensure all the required tools are available
@mokagio
mokagio / TitleAndValueRowWithPresenter.swift
Created Jul 26, 2017
TitleAndValueRowWithPresenter.swift
View TitleAndValueRowWithPresenter.swift
import Eureka
/// This row is build based on the implementation of `ButtonRowWithPresent`, and
/// allows consurmers to set a detail value for the row, which is not possible
/// in the other.
///
/// To set the value use `$0.cellUpdate { cell, _ in cell.detailLabel?.text = "value" }`.
///
/// - See: https://github.com/xmartlabs/Eureka/blob/master/Source/Rows/ButtonRowWithPresent.swift
open class _TitleAndValueRowWithPresenter<VCType: TypedRowControllerType>: Row<LabelCellOf<VCType.RowValue>>, PresenterRowType where VCType: UIViewController {
@mokagio
mokagio / NSDate+EasyTuning.swift
Created May 20, 2016
This NSDate extension provides a builder method intended to be used to simplify creating dates in unit tests.
View NSDate+EasyTuning.swift
import Foundation
/// This `NSDate` extension provides a builder method intended to be used to
/// simplify creating dates in unit tests.
extension NSDate {
static func date(
year year: Int = 1970,
month: Int = 01,
day: Int = 01,
@mokagio
mokagio / update_xcode_plugins.sh
Last active May 17, 2019
Script updating all plugins to be compatible with the latest Xcode and Xcode-beta
View update_xcode_plugins.sh
#!/bin/bash
#
# Updates all plug-ins to be compatible with the latest Xcode and Xcode-beta
#
plugins_location="~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins"
# Get Xcode's version
current_xcode_version="$(defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID)"
You can’t perform that action at this time.