This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AuthViewModel : BaseViewModel { | |
func loginUser(email: String, password: String, completion: @escaping (_ success : Bool, _ error : NSError?) -> Void){ | |
Network.shared.apollo.perform(mutation: BundulAPI.LoginUserMutation(loginInput: NameOfAPI.LoginInput(email: email, password: password))) { result in | |
switch result { | |
case .success(let graphQLResult): | |
print("Success! Result: \(graphQLResult)") | |
completion(true, nil) | |
case .failure(let error): | |
print("Failure! Error: \\(error)") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let month = ["January","February","March","April","May","June","July", | |
"August","September","October","November","December"] | |
let month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul","Aug", "Sep", "Oct", "Nov", "Dec"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Home: View { | |
var body: some View { | |
VStack(){ | |
} | |
.focusable() | |
.touchBar{ | |
HStack(spacing: 5){ | |
Button(action: { zoomMinus() }) { | |
Image("minus.magnifyingglass").font(.system(size: 18, weight: .light)) | |
}.padding([.trailing, .leading], 5).buttonStyle(PlainButtonStyle()).tooltip("Zoom Out") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
// server.js | |
// load the things we need | |
//This is to parse the arguments from the cmd line | |
const optimist = require('optimist'); | |
//listen for our initial argument. | |
const abArray = optimist.argv["array"]; | |
let insideArray = [1,2,3,[1,2,[4,5],3,4],2]; | |
let passedInput = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let cardParams = PSTCKCardParams.init() | |
let cardNumber: String = cardNumbField.text! | |
let ccvFieldString: String = ccvField.text! | |
cardParams.number = cardNumber | |
cardParams.cvc = ccvFieldString | |
cardParams.expYear = 2020 | |
cardParams.expMonth = 9 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func getIfImageHasTransparentBackground(image: NSImage) -> Bool { | |
var hasTransparentBackground : Bool = false | |
let cgImage = image.cgImage | |
let context = createARGBBitmapContextFromImage(cgImage: cgImage!) | |
let height = cgImage!.height | |
let width = cgImage!.width | |
let rect: CGRect = CGRect(x: 0, y: 0, width: CGFloat(width), height: CGFloat(height)) | |
context?.draw(cgImage!, in: rect) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Access Bank" , "Citibank", "Diamond Bank", "Dynamic Standard Bank", "Ecobank Nigeria", "Fidelity Bank Nigeria", "First Bank of Nigeria", "First City Monument Bank", "Guaranty Trust Bank", "Heritage Bank Plc","Jaiz Bank","Keystone Bank Limited", "Providus Bank Plc", "Skye Bank", "Stanbic IBTC Bank Nigeria Limited", "Standard Chartered Bank", "Sterling Bank", "Suntrust Bank Nigeria Limited", "Union Bank of Nigeria", "United Bank for Africa", "Unity Bank Plc", "Wema Bank", "Zenith Bank" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Setting the padding on the BottomAppBar instead clips out the menuview for some | |
* reasons. Feel it's a bug. | |
* | |
* So instead would just get the ActionMenuView which houses the menu and apply the | |
* padding to that instead. | |
* | |
* Reuben 1. Google 0. | |
* **/ | |
for(int i = 0; i < bottomAppBar.getChildCount(); ++i) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
class CustomDarkUIView: UIView { | |
let gradientLayer = CAGradientLayer() | |
override func layoutSubviews() { | |
// resize your layers based on the view's new frame |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# source : http://code.google.com/p/natvpn/source/browse/trunk/stun_server_list | |
# A list of available STUN server. | |
stun.l.google.com:19302 | |
stun1.l.google.com:19302 | |
stun2.l.google.com:19302 | |
stun3.l.google.com:19302 | |
stun4.l.google.com:19302 | |
stun01.sipphone.com | |
stun.ekiga.net |