Text
HP/Aruba 2530-48G-2SFP+ enable 3rd party transceivers
Telnet into your HP/Aruba 2530 switch that is running the latest firmware (at least 16.02.0016) and under the config menu send the following command
allow-unsupported-transceiver
0 notes
Link
0 notes
Link
0 notes
Text
Swift Class Structure with Initializer and Default Values
Here’s an example of swift class for a rectangle that has an initializer and optional default values.
import Foundation
class Rectangle: Codable {
var name:String
var length:Int
var width:Int
init(name:String = "", length:Int = 4, width:Int = 2) {
self.name = name
self.length = length
self.width = width
}
}
This rectangle will have an area of 8 by default:
r = Rectangle()
print(r.length * r.width) // => 8
but if we define the width to be 4, we will have a square with an area of 16
s = Rectangle(width: 4)
print(s.length * s.width) // => 16
This also allows you to be able to instantiate your class without defining all values and not have it blow up on you.
0 notes
Text
Working with Swift LocationManager
I started out creating location managers on each controller and then I read this. As there should ever only be one instance of the LocationManager, a singleton is definitely the right way to go.
Swift 3 Singleton
import CoreLocation class LocationManager: CLLocationManager { var isUpdatingLocation = false static let shared = LocationManager() override func startUpdatingLocation() { super.startUpdatingLocation() isUpdatingLocation = true } override func stopUpdatingLocation() { super.stopUpdatingLocation() isUpdatingLocation = false } }
Usage
if LocationManager.shared.isUpdatingLocation { print("Is currently updating location.") } else { print("Location updates have stopped.") }
0 notes
Text
XCode 8.3 / Xcode 9.0 Refresh provisioning profile devices
Go to ~/Library/MobileDevice/Provisioning\ Profiles/ and delete all the provisioning profiles from there.
Go to XCode > Preferences > Accounts and select the Apple Id.
Click Download All Profiles. And it will download all the provisioning profiles again.
Xcode 9
Step 1 and 2 remain the same.
Click Download Manual Profiles to update your provisioning profiles.
Taken from: https://stackoverflow.com/questions/44060482/xcode-8-3-xcode-9-0-refresh-provisioning-profile-devices
0 notes
Text
Previewing your Ruby on Rails mailer locally.
You can preview your rails mailer locally without needing to send it by going to
http://localhost:3000/rails/mailers/user_mailer/new_user
This will show you the HTML preview of the “new_user” template located in the user_mailer view folder. ENJOY!
0 notes
Text
Find processes that are using a specific port in OSX
Use the “List Open Files” command to display the PIDs of any process using a TCP port
lsof -wni tcp:<port_number>
0 notes
Text
Recording iOS Simulator to Video in Xcode
The easiest way to get the device parameter is to launch the simulator manually through Xcode, then use the value booted:
xcrun simctl io booted recordVideo <path>
Recording begins immediately, and continues until you kill the simctlprocess by pressing ^C.
0 notes
Link
0 notes
Link
0 notes
Text
Command to generate new rails project with web pack for react and postgres database
rails new yourProjectName --webpack=react --database=postgresql -T
0 notes
Video
youtube
Pretty good, casual overview on react native for iOS.
0 notes