Skip to content

Instantly share code, notes, and snippets.

View mendesbarreto's full-sized avatar
🔥
Learning NeoVim

Douglas Mendes Barreto mendesbarreto

🔥
Learning NeoVim
View GitHub Profile
@mendesbarreto
mendesbarreto / parse-gihtub-issues-tsv-to-markdown.ts
Last active November 6, 2023 21:50
Little script to parse the TSV provided by GitHub projects to a markdown format
import { readFileSync, writeFileSync } from 'fs';
function readGithubProjectTSV(path: string) {
const fileContent = readFileSync(path, { encoding: 'utf8' });
const rows = fileContent.split('\n');
rows.shift();
rows.sort();
@mendesbarreto
mendesbarreto / WeakSelfMethodReference.swift
Created October 8, 2019 18:27
This very useful to make the methods weak
//
// Created by Douglas Mendes on 2019-10-08.
// Copyright (c) 2019 Douglas Mendes. All rights reserved.
//
import Foundation
func weakify<TargetType: AnyObject>(_ target: TargetType,
_ targetMethod: @escaping (TargetType) -> () -> Void) -> (() -> Void) {
return { [weak target] in
import Crashlytics
extension Crashlytics: LogRecorder {
func record(log: String, reason _: String? = nil) {
CLSLogv("%@", getVaList([log]))
}
func record(errorString: String, reason: String? = nil) {
recordCustomExceptionName(errorString, reason: reason, frameArray: [])
}
import Foundation
import Firebase
final class AppUpdateCheckerFactory {
static func make(debugMode: Bool = false) -> AppUpdateChecker {
if debugMode {
activateDebugMode()
}
return AppUpdateChecker(currentAppVersion: Environment.appVersion,
remoteConfig: RemoteConfig.remoteConfig())
@mendesbarreto
mendesbarreto / install_cygwin_sshd.txt
Created October 16, 2018 18:26 — forked from roxlu/install_cygwin_sshd.txt
Installing CYGWIN + SSHD for remote access through SSH on windows
Installing CYGWIN with SSH
1) Download cygwin setup.exe from http://www.cygwin.com
- Execute setup.exe
- Install from internet
- Root directory: `c:\cygwin` + all users
- Local package directory: use default value
- Select a mirror to download files from
- Select these packages:
- editors > xemacs 21.4.22-1
- net > openssh 6.1-p
@mendesbarreto
mendesbarreto / UIView.swift
Created April 28, 2018 15:18
Extension for help build constraints without storyboard and libs
//
// Created by Douglas Mendes on 4/18/18.
// Copyright (c) 2018 Douglas Mendes. All rights reserved.
//
import UIKit
extension UIView {
@discardableResult
func startAnchor() -> Self {
@mendesbarreto
mendesbarreto / ItemSelector.swift
Created March 29, 2018 22:52
Crete a Colletion view with item selector
//
// ViewController.swift
// ItemSelector
//
// Created by douglas.barreto on 3/26/18.
// Copyright © 2018 Douglas Mendes Barreto. All rights reserved.
//
import Foundation
import UIKit
@mendesbarreto
mendesbarreto / HomeViewController.swift
Last active September 12, 2019 18:00
Example of how to create a view controller with nib
//
// HomeViewControllerTests.swift
// DitMoi
//
// Created by Douglas Barreto on 10/01/18.
// Copyright © 2018 Douglas Mendes. All rights reserved.
//
import UIKit
@mendesbarreto
mendesbarreto / AppCodeWorkspace.xml
Created February 27, 2018 19:03
Save code style for appcode
<code_scheme name="Douglas Mendes Barreto" version="173">
<Objective-C-extensions>
<file>
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" />
//: A UIKit based Playground for presenting user interface
import UIKit
import PlaygroundSupport
protocol ListGroceriesPresenter {
func show(groceries: [Int])
func show(grocery: Int)
func showEmptyView()
}