Skip to content

Instantly share code, notes, and snippets.

View NunoAlexandre's full-sized avatar

Nuno NunoAlexandre

View GitHub Profile
@NunoAlexandre
NunoAlexandre / storkExampleTypes.swift
Created March 25, 2019 19:26
Stork Example Types
struct User {
let id: Int
let name: String
let email: String?
let country: Country?
let subscription: Subscription
let favouriteSongs: [Song]
}
enum Subscription: String {
@NunoAlexandre
NunoAlexandre / User+FromJson.swift
Created March 25, 2019 19:30
Making User FromJson compliant
extension User: FromJson {
static func from(value: JsonValue) -> User? {
return value.ifObject { json in
User(
id: try json .! "id",
name: try json .! "name",
email: json .? "email",
country: json .? "country",
subscription: try json .! "subscription",
favouriteSongs: (json ..? "favouriteSongs") ?? []
@NunoAlexandre
NunoAlexandre / small-step-before.swift
Created July 17, 2019 11:08
A small step - before
observers.append(NotificationCenter.default.addObserver(forName: AVAudioSession.interruptionNotification, object: nil, queue: nil) { [weak weakSelf = self] (notification) in
weakSelf?.onInterruption(notification)
})
observers.append(
NotificationCenter.default.addObserver(
forName: AVAudioSession.interruptionNotification,
object: nil,
queue: nil
)
{ [weak weakSelf = self] (notification) in
weakSelf?.onInterruption(notification)
}
)
@NunoAlexandre
NunoAlexandre / easier-github.css
Created September 9, 2020 18:58
Easier Github on the eyes
.xHeader-item--full {
width: 2;
width: auto !important;
margin: 0 auto !important;
flex: none;
}
xbody,.Box {
background-color: #e7e7e7;
}

Open

=> ERROR [9/9] RUN brownie compile 29.1s
------
> [9/9] RUN brownie compile:
#13 1.187 Brownie v1.16.4 - Python development framework for Ethereum
#13 1.187
13.5kiB [00:00, 632kiB/s]
#13 1.458 Downloading from https://solc-bin.ethereum.org/linux-amd64/solc-linux-amd64-v0.8.7+commit.e28d00a7
100%|██████████| 12.1M/12.1M [00:21<00:00, 558kiB/s]
#13 23.33 qemu-x86_64: Could not open '/lib64/ld-linux-x86-64.so.2': No such file or directory
#13 23.41 Downloading from https://solc-bin.ethereum.org/linux-amd64/solc-linux-amd64-v0.8.9+commit.e5eed63a
/// This module contains useful extensions to the base
/// navigation controllers in respect to managing orientation,
/// as well as adding missing functionality to the sdk types.
import Foundation
func currentOrientation() -> UIInterfaceOrientation {
return UIApplication.shared.statusBarOrientation
}
λ kubectl logs -f centrifugechainvalidator-0-7df4d577dd-jzhsh -n altair-dev-rococo
2022-04-25 08:30:17.463 INFO main sc_cli::runner: Centrifuge Parachain Collator
2022-04-25 08:30:17.463 INFO main sc_cli::runner: ✌️ version 0.10.11-aa467c6-x86_64-linux-gnu
2022-04-25 08:30:17.463 INFO main sc_cli::runner: ❤️ by Centrifuge <admin@centrifuge.io>, 2017-2022
2022-04-25 08:30:17.463 INFO main sc_cli::runner: 📋 Chain specification: Altair Dev
2022-04-25 08:30:17.463 INFO main sc_cli::runner: 🏷 Node name: altair-dev-rococo-collator-0
2022-04-25 08:30:17.463 INFO main sc_cli::runner: 👤 Role: AUTHORITY
2022-04-25 08:30:17.463 INFO main sc_cli::runner: 💾 Database: RocksDb at /data/chains/altair_dev/db/full
2022-04-25 08:30:17.463 INFO main sc_cli::runner: ⛓ Native runtime: altair-1012 (altair-1.tx1.au1)
2022-04-25 08:30:17.528 INFO main pallet_collator_selection::pallet: assembling new collators for new session 0 at #0
@NunoAlexandre
NunoAlexandre / tooexpensive
Created May 11, 2022 07:23
AIR :: Karura -> Altair -> TooExpensive
2022-05-11 07:07:25.259 TRACE tokio-runtime-worker xcm::barriers: [Parachain] AllowTopLevelPaidExecutionFrom origin: MultiLocation { parents: 1, interior: X1(Parachain(2000)) }, message: Xcm([WithdrawAsset(MultiAssets([MultiAsset { id: Concrete(MultiLocation { parents: 0, interior: X1(GeneralKey([0, 1])) }), fun: Fungible(1230000000000000) }])), ClearOrigin, BuyExecution { fees: MultiAsset { id: Concrete(MultiLocation { parents: 0, interior: X1(GeneralKey([0, 1])) }), fun: Fungible(1230000000000000) }, weight_limit: Limited(8000000000000) }, DepositAsset { assets: Wild(All), max_assets: 1, beneficiary: MultiLocation { parents: 0, interior: X1(AccountId32 { network: Any, id: [128, 241, 117, 106, 136, 26, 216, 208, 30, 206, 60, 179, 42, 74, 100, 193, 146, 67, 107, 35, 118, 33, 130, 230, 131, 203, 112, 123, 142, 236, 66, 89] }) } }]), max_weight: 800000000, weight_credit: 0
2022-05-11 07:07:25.259 TRACE tokio-runtime-worker xcm::execute: [Parachain] origin: Some(MultiLocation { parents: 1, interior: X1(Parachain