Skip to content

Instantly share code, notes, and snippets.

Sofia Swidarowicz phynet

Block or report user

Report or block phynet

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
View conf_terminal.txt
https://tonyxu.io/posts/2018/ultimate-way-to-beautify-mac-terminal-and-recommendations-for-plugins/
@phynet
phynet / show_view_controller_using_navigation_stack.swift
Created Jul 26, 2018
presenting a new VC from a modal and setting the navigation stack to other VC
View show_view_controller_using_navigation_stack.swift
func primaryButtonPressed() {
weak var pvc = self.presentingViewController
dismiss(animated: true, completion: {
let myTripsView: MyTripsHomeViewController = ModulesAssembler().resolve()
let home: ODGBaseHomeViewController = ODGBaseHomeViewController()
if var navstack = myTripsView.navigationController?.viewControllers {
navstack.append(contentsOf: [home])
myTripsView.navigationController?.setViewControllers(navstack, animated: true)
View subscript.swift
//: Playground - noun: a place where people can play
//Subscript: shortcut for accessing the member elements in a collection, list, or sequence.
import UIKit
//#1
struct TimesTable {
let multiplier: Int
subscript(index: Int) -> Int {
return multiplier * index
@phynet
phynet / elm-swift-redux.mkd
Last active May 13, 2018
elm-swift-redux info
View elm-swift-redux.mkd
  Elm uses the functional reactive programming style and purely functional graphical layout to
  build user interface without any destructive updates. It enforces a “model view update”
  architecture, where the update has the following signature: (action, state) -> state 

http://www.appventure.me/2016/10/14/reswift-pattern/

@phynet
phynet / TableDataSource.mkd
Created Apr 22, 2018
This class is a simple, immutable, declarative data source for UITableView
View TableDataSource.mkd
 import UIKit

    /// This class is a simple, immutable, declarative data source for UITableView
    final class TableDataSource<V, T> : NSObject, UITableViewDataSource where V: UITableViewCell {

      typealias CellConfiguration = (V, T) -> V

      private let models: [T]
      private let configureCell: CellConfiguration
@phynet
phynet / Emoji-markdown.md
Last active Mar 31, 2018 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup
View Emoji-markdown.md

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
View printing-log-swift.swift
import Foundation
public struct Log
{
public static var isEnabled = true
public static func debug(_ m: @autoclosure ()->String, _ file: Any? = #file, _ f: String = #function, _ line: UInt = #line) {
print(m(), file ?? "", f, line)
}
View set_permission_ios_for_UI_test.mkd
   brew tap wix/brew

This line is for GNU instalation, because old syntaxis uses POSIX and to run new scripts is necessary to use GNU

    brew install gnu-sed grep --with-default-names

Update new commands for mac that uses GNU

    brew install bash
    chsh -s /usr/local/bin/bash
@phynet
phynet / insetsForLabel.m
Created Oct 9, 2017
Class to create insets in UILabel
View insetsForLabel.m
#import "RLInsetsLabel.h"
#import "UIView+Utils.h"
@implementation RLInsetsLabel
- (void)awakeFromNib {
[super awakeFromNib];
self.edgeInsets = UIEdgeInsetsMake(self.topEdge, self.leftEdge, self.bottomEdge, self.rightEdge);
}
- (id)initWithFrame:(CGRect)frame {
@phynet
phynet / parse-html-string.swift
Created Oct 5, 2017
parse html string to string in swift
View parse-html-string.swift
import Foundation
import UIKit
@objc extension NSString {
class func parseHTMLString(stringHTML: String) -> NSString {
return try! NSAttributedString(
data: stringHTML.data(using: String.Encoding.unicode, allowLossyConversion: true)!,
options: [ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType],
You can’t perform that action at this time.