Skip to content

Instantly share code, notes, and snippets.

View elefantel's full-sized avatar

Mpendulo Ndlovu elefantel

  • MetaMask
  • Cape Town, WC
  • 14:44 (UTC +02:00)
View GitHub Profile
2024-03-18 00:29:27.148 12405-12405 MM_ANDROID_SDK com.metamask.dapp D SessionManager:: Session duration extended by: 7.0 days
2024-03-18 00:29:29.732 12405-12405 MM_ANDROID_SDK com.metamask.dapp D Ethereum:: connecting...
2024-03-18 00:29:29.734 12405-12405 MM_ANDROID_SDK com.metamask.dapp D SessionManager:: Session duration extended by: 7.0 days
2024-03-18 00:29:29.748 12405-12405 MM_ANDROID_SDK com.metamask.dapp D Ethereum:: Requesting ethereum accounts
2024-03-18 00:29:29.751 12405-12405 MM_ANDROID_SDK com.metamask.dapp D Ethereum:: Sending request EthereumRequest(id=1710714569751, method=eth_requestAccounts, params=null)
2024-03-18 00:29:29.751 12405-12405 MM_ANDROID_SDK com.metamask.dapp D CommunicationClient:: Queued job
2024-03-18 00:29:29.751 12405-12405 MM_ANDROID_SDK com.metamask.dapp D Communicatio
protocol Theme {
static var isLunoV3Enabled: Bool { get }
}
/**
A theme type that is dynamically determined based on the `isLunoV3Enabled` flag
*/
extension Theme {
static var color: ThemeColor.Type {
isLunoV3Enabled ? LunoThemeColor.self : LegacyThemeColor.self
@elefantel
elefantel / Theme.swift
Last active September 22, 2021 22:06
A theming protocol for abstracting Luno fonts and colour themes
protocol Theme {
static var isLunoV3Enabled: Bool { get }
}
/**
Theme type dynamically determined based on the `isLunoV3Enabled` flag
*/
extension Theme {
static var color: ThemeColor.Type {
isLunoV3Enabled ? LunoThemeColor.self : LegacyThemeColor.self
### Keybase proof
I hereby claim:
* I am elefantel on github.
* I am mpendulo (https://keybase.io/mpendulo) on keybase.
* I have a public key ASC0g8nrAOGBgRt4OZX7PHe6FGbDzLlz7e76_u5xAor91go
To claim this, I am signing this object:
@elefantel
elefantel / CustomCell.swift
Created May 2, 2017 16:18
A custom cell with a title label, a text field and an error label
class CustomCell: UITableViewCell {
var textField: UITextField!
var titleLabel: UILabel!
var errorLabel: UILabel!
static var identifier: String {
return "\(CustomCell.self)"
}
@elefantel
elefantel / RegistrationViewController.swift
Last active May 2, 2017 23:09
A view controller with scrolling that uses keyboard observing to shift input fields to remain above keyboard.
class RegistrationViewController: UIViewController, KeyboardDisplayChangeProtocol, UITableViewDelegate, UITableViewDataSource {
public enum FormField: String {
case name = "Name"
case surname = "Surname"
case age = "Age"
case email = "Email"
case telephone = "Telephone"
case username = "Username"
case password = "Password"
@elefantel
elefantel / KeyboardObservingTableView.swift
Created May 2, 2017 16:04
Tableview that observes changes in keyboard display
protocol KeyboardDisplayChangeProtocol {
func addKeyboardObserver(on view: UIView)
func removeKeyboardObserver()
}
public class KBTableView: UITableView {
weak var view: UIView?
public func addKeyboardObserver(on view: UIView) {
@elefantel
elefantel / master_script.sh
Created March 20, 2017 22:09
Clone, carthage update, and build
#!/bin/bash
clone_repos() {
./clone_repos.sh all
}
carthage_update() {
./carthage_update.sh all
}
#!/bin/bash
HARDWARE="iphonesimulator"
CONFIGURATION="Debug"
for i in "$@"; do
if [ "$i" = "all" ]
then
echo "====== Building all Frameworks ======"
xcodebuild -project encryption-sdk/EncryptionSDK.xcodeproj -configuration $CONFIGURATION -sdk $HARDWARE -scheme EncryptionSDK
@elefantel
elefantel / carthage_update.sh
Created March 20, 2017 21:53
Run carthage update on each module
#!/bin/bash
update_encryption_sdk() {
echo '--------------------------------------------------'
echo 'Running Carthage update on EncryptionSDK'
echo '--------------------------------------------------'
cd ../encryption-sdk/
run_carthage_update
}