Skip to content

Instantly share code, notes, and snippets.

View BrayanMC's full-sized avatar
🏠
Working from home

BrayanMC BrayanMC

🏠
Working from home
View GitHub Profile
@BrayanMC
BrayanMC / iterm2-solarized.md
Created June 2, 2021 05:25 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@BrayanMC
BrayanMC / String+ChangePartTextColor.swift
Created June 27, 2020 19:21
Change part of the text color.
func attributedStringWithColor(_ strings: [String], color: UIColor,font : UIFont, characterSpacing: UInt? = nil) -> NSAttributedString {
let attributedString = NSMutableAttributedString(string: self)
for string in strings {
let range = (self as NSString).range(of: string)
attributedString.addAttribute(NSAttributedString.Key.foregroundColor, value: color, range: range)
attributedString.addAttribute(NSAttributedString.Key.font,value: font, range: range)
}
guard let characterSpacing = characterSpacing else {return attributedString}
@BrayanMC
BrayanMC / docker-cleanup-resources.md
Created April 19, 2020 00:14 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@BrayanMC
BrayanMC / read_save_userdefaults.swift
Last active December 28, 2018 07:32
Read and save objetcs or something else using UserDefaults
private var swtSelected = [String : Bool]()
func save() {
let preferences = UserDefaults.standard
let currentLevelKey = Constants.PREFERENCE_OPTIONS_CHECKED
preferences.set(swtSelected, forKey: currentLevelKey)
let didSave = preferences.synchronize()
if !didSave {
debugPrint("don't save")
}
@BrayanMC
BrayanMC / vehicular_loan_card_background.xml
Created July 31, 2018 23:12
don't show top border for views
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<stroke
android:width="2dp"
android:color="#d9e7f6" />
</shape>
</item>
@BrayanMC
BrayanMC / build.gradle
Last active October 12, 2017 00:15
How to get the current operating system to be able to give the keystore route, for example, according to this
...
android {
// GET THE DATA OF THE OPERATING SYSTEM WHERE ANDROID STUDIO IS RUN
String osName = org.gradle.internal.os.OperatingSystem.current().getName();
String osVersion = org.gradle.internal.os.OperatingSystem.current().getVersion();
signingConfigs {
config {