Skip to content

Instantly share code, notes, and snippets.

View alvieirajr's full-sized avatar

Antônio Vieira alvieirajr

  • Brazil, Recife
View GitHub Profile
vagrant : INFO global: Vagrant version: 2.3.4
No linha:1 caractere:1
+ vagrant up --debug 2>&1 | Tee-Object -FilePath ".\vagrant.log"
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: ( INFO global: Vagrant version: 2.3.4:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
INFO global: Ruby version: 2.7.6
INFO global: RubyGems version: 3.1.6
INFO global: VAGRANT_EXECUTABLE="C:\\HashiCorp\\Vagrant\\embedded\\gems\\2.3.4\\gems\\vagrant-2.3.4\\bin\\vagrant"
@alvieirajr
alvieirajr / combineSwiftUI.swift
Last active March 24, 2020 00:29
Combine + SwitUI
import SwiftUI
import Combine
struct ContentView: View {
var presenter = Presenter()
/*SwiftUI manages the storage of any property you declare as a state. When the state value changes, the view invalidates its appearance and recomputes the body. Use the state as the single source of truth for a given view.*/
@State private var stringToDisplay:String?
var body: some View {
let vStack = VStack {
Text(stringToDisplay ?? "Empty")
//
// (BACKEND)
//
//var sourceRandom = Rx.Observable.from([1, 2, 3, 6, 8, 7, 5, 4, 9]);
//+ Create a stream of random numbers. (BACKEND)
var sourceRandom = Rx.Observable
.interval(100)
.timeInterval()
.map(function(value) {
"use strict";
var property = { baseValue: 5 }; // Parts of model domain (domain properties).
var someBehavior = function (params) { // implementation domain.
return this.baseValue + params;
};
var result = someBehavior.call(property, 4);
var sendMessage = function(a,b) {
console.log('Message sent to: ' + a + ', content: ' + b);
};
var phone = function(spec) {
var that = {};
that.getPhoneNumber = function() {
var first = (function() {
var chainNames = ["then", "andThen", "next"];
var endChainNames = ["finally", "andFinally", "last"];
var chain = function(fn) {
var f1 = function(g) {
var func = function() {return g.call(this,
fn.apply(this, arguments));};
chain(func);
return func;
};
var compose = function compose(f) {
var queue = f ? [f] : [];
var fn = function fn(g) {
if (arguments.length) {
queue.push(g);
return fn;
}
return function() {
var args = Array.prototype.slice.call(arguments);
queue.forEach(function(func) {
var compose = function() {
var funcs = arguments;
return function() {
var args = arguments;
for (var i = funcs.length; i --> 0;) {
args = [funcs[i].apply(this, args)];
}
return args[0];
};
};
var compose = function() {
var funcs = arguments;
return function() {
var args = arguments;
for (var i = funcs.length; i --> 0;) {
args = [funcs[i].apply(this, args)];
}
return args[0];
};
};
var compose = function(f, g) {
return function() {
return f.call(this, g.apply(this, arguments));
};
};