Skip to content

Instantly share code, notes, and snippets.

View FarisAlbalawi's full-sized avatar
🎧

Faris Albalawi FarisAlbalawi

🎧
View GitHub Profile
@lamprosg
lamprosg / UIImage+Darkness.swift
Created June 24, 2020 10:17
(iOS) Check image darkness
import UIKit
// Call CGImage mechanism from a UIImage
@objc extension UIImage {
var isDark: Bool {
self.cgImage?.isDark ?? false
}
}
@lamprosg
lamprosg / CircularProgressBar.swift
Created October 13, 2019 12:21
(iOS) Circular progress bar - UIView subclass
import Foundation
import UIKit
class CountdownProgressBar: UIView {
private var timer = Timer()
private var duration = 5.0
private var remainingTime = 0.0
private var showPulse = false
@bricef
bricef / AES.c
Last active May 11, 2024 21:15
A simple example of using AES encryption in Java and C.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*
* MCrypt API available online:
* http://linux.die.net/man/3/mcrypt
*/
#include <mcrypt.h>