sudo install fail2ban
sudo install ufw
sudu ufw default deny incomoing
sudo ufw default allow outgoins
version: "3.6" | |
services: | |
gitlab: | |
image: gitlab/gitlab-ce | |
volumes: | |
- gitlab-data:/var/opt/gitlab | |
- gitlab-logs:/var/log/gitlab | |
- gitlab-config:/etc/gitlab | |
networks: | |
- traefik-public |
/** | |
* Extracts the list of data from a PagingData object. | |
* Useful for testing transformations on PagingData. | |
* | |
* flowOf(PagingData.from(listOf(model)).toList() == listOf(model) | |
* | |
* When nothing else is left, Java reflection will always be there to help us out. | |
*/ | |
@Suppress("UNCHECKED_CAST") | |
private suspend fun <T : Any> PagingData<T>.toList(): List<T> { |
public class MyApplication implements LifecycleObserver { | |
@Override | |
public void onCreate() { | |
ProcessLifecycleOwner.get().getLifecycle().addObserver(this); | |
} | |
@OnLifecycleEvent(Lifecycle.Event.ON_START) | |
public void onStart() { | |
Log.d("App in foreground"); |
// | |
// DayCellView.swift | |
// T-Shifts | |
// | |
// Created by Roberto Esposito on 09/02/2017. | |
// Copyright © 2017 Roberto Esposito. All rights reserved. | |
// | |
import Foundation | |
import JTAppleCalendar |
extension AnyObserver { | |
static func create<E>(_ relay: PublishRelay<E>) -> AnyObserver<E> { | |
return .init { event in | |
guard case let .next(value) = event else { return } | |
relay.accept(value) | |
} | |
} | |
static func create<E>(_ relay: BehaviorRelay<E>) -> AnyObserver<E> { | |
return .init { event in |
At the moment id don´t know how to authenticate so i have no clue to download the xip via curl/wget.
In my case i downloaded the file and copied it via scp to my mac.
eg. for Xcode 9.2 https://developer.apple.com/services-account/download?path=/Developer_Tools/Xcode_9.2/Xcode_9.2.xip
pkgutil --verbose --check-signature path/to/xip
// Thanks to @MonsieurDart for the idea :) | |
func scroll(collectionView:XCUIElement, toFindCellWithId identifier:String) -> XCUIElement? { | |
guard collectionView.elementType == .collectionView else { | |
fatalError("XCUIElement is not a collectionView.") | |
} | |
var reachedTheEnd = false | |
var allVisibleElements = [String]() | |
while !reachedTheEnd { |
#MIT License | |
# | |
#Copyright (c) 2017 Daniele Andreis | |
#Permission is hereby granted, free of charge, to any person obtaining a copy | |
#of this software and associated documentation files (the "Software"), to deal | |
#in the Software without restriction, including without limitation the rights | |
#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
#copies of the Software, and to permit persons to whom the Software is | |
#furnished to do so, subject to the following conditions: | |
# |
var drivingSchedule = {}; | |
var turnNumber = 0; | |
var MIN_VISITS_PER_VEHICLE = 1; // to keep everyone busy | |
var OPTIMIZE_EVERY_X_TURNS = 5; | |
var turn = function(vehicles, people, buildings) { | |
'use strict'; | |
if(turnNumber % OPTIMIZE_EVERY_X_TURNS === 0 && turnNumber < 1000) { | |
// Parse data to be suitable for Routific's API |