Skip to content

Instantly share code, notes, and snippets.

View jnawaz's full-sized avatar

Jamil Nawaz jnawaz

View GitHub Profile
@jnawaz
jnawaz / README.md
Created June 19, 2023 11:47 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@jnawaz
jnawaz / setup.sh
Last active March 19, 2025 13:01 — forked from bradp/setup.sh
New Mac Setup Script
echo "Creating an SSH key for you..."
ssh-keygen -t rsa
echo "Please add this public key to Github \n"
echo "https://github.com/account/ssh \n"
read -p "Press [Enter] key after this..."
echo "Installing xcode-stuff"
xcode-select --install
@jnawaz
jnawaz / ClearCoreData.swift
Last active June 20, 2017 14:39
Clear all Core Data entities
func flushCoreData() {
let entities = managedObjectModel.entities
for entity in entities {
let fetchRequest = NSFetchRequest<NSFetchRequestResult>(entityName: entity.name!)
let deleteReqest = NSBatchDeleteRequest(fetchRequest: fetchRequest)
do {
try managedObjectContext?.execute(deleteReqest)
} catch {
print(error)
}
@jnawaz
jnawaz / FontFamily.swift
Created January 25, 2017 09:49
Code snippet that helps workout the name of the font when using custom Fonts
for name in UIFont.familyNames {
print(name)
print("\n")
if let nameString = name as? String {
print(UIFont.fontNames(forFamilyName:nameString))
print("\n")
}
}