Skip to content

Instantly share code, notes, and snippets.

View alexander480's full-sized avatar
🎯
Focusing

Alexander Lester alexander480

🎯
Focusing
View GitHub Profile
@kieranb662
kieranb662 / XcodeKitHelpers.md
Last active April 6, 2023 15:44
[Xcode Editor Notes] Xcodekit Extensions to help make Xcode your own custom text editor.

Xcode Editor Notes

Suggestions

After adding the Extension target to a project

  1. Go to the menu bar -> Product -> Scheme -> Edit Scheme.
  2. Under the info tab change the executable dropdown menu to "Xcode.app".
  3. If you have a testing file add it to the "Arguments Passed On Launch" field under the Arguments tab.
@yukin01
yukin01 / DesignableView.swift
Last active February 23, 2021 05:11
Add @IBDesignable and @IBInspectable to UIView, UIButton, UIImageView and UITextField
import UIKit
protocol Roundable {
var cornerRadius: CGFloat { get set }
}
protocol Borderable {
var borderWidth: CGFloat { get set }
var borderColor: UIColor? { get set }
}
protocol Shadowable {
@phpsmarter
phpsmarter / faceDection.html
Created March 29, 2018 00:24
google FaceDection
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Live Face Detector</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.error-msg {
@kharrison
kharrison / RSSFeed.swift
Last active September 1, 2021 01:59
Swift Decodable With Multiple Custom Dates
import Foundation
extension DateFormatter {
static let iso8601Full: DateFormatter = {
let formatter = DateFormatter()
formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ"
formatter.calendar = Calendar(identifier: .iso8601)
formatter.timeZone = TimeZone(secondsFromGMT: 0)
formatter.locale = Locale(identifier: "en_US_POSIX")
return formatter
@leilee
leilee / UIView+GradientBorder.swift
Last active March 29, 2024 12:05
Add gradient border to UIView
public extension UIView {
private static let kLayerNameGradientBorder = "GradientBorderLayer"
public func setGradientBorder(
width: CGFloat,
colors: [UIColor],
startPoint: CGPoint = CGPoint(x: 0.5, y: 0),
endPoint: CGPoint = CGPoint(x: 0.5, y: 1)
) {
@yottu
yottu / nextcloud-install-jessie.sh
Last active November 9, 2018 01:07
Installing nextcloud 12.0 on Debian GNU/Linux (Jessie) [Apache2/mysql]
### Written: 2017-06-13
### Updated: -
### Get, verify and unpack, delete and move the distribution package (12.0)
wget https://download.nextcloud.com/server/releases/nextcloud-12.0.0.tar.bz2
wget https://download.nextcloud.com/server/releases/nextcloud-12.0.0.tar.bz2.sha256
sha256sum -c nextcloud-12.0.0.tar.bz2.sha256 < nextcloud-12.0.0.tar.bz2.sha256
tar xvf nextcloud-12.0.0.tar.bz2 && rm nextcloud-12.0.0.tar.bz2
sudo mv nextcloud /var/www/
@DomPizzie
DomPizzie / README-Template.md
Last active July 26, 2024 18:25
A simple README.md template

Project Title

Simple overview of use/purpose.

Description

An in-depth paragraph about your project and overview of use.

Getting Started

@blownupp
blownupp / gist:24a1d7e042f84aa06bd212bb58c2ae44
Last active April 9, 2019 19:38
Open Source Smok: Early Notes
Add early information here. -bu
We currently need:
- High resolution photos of the Alien 220w mod pcb, front and back
* Difference between VB and V Alien revisions
NUC220LE3AN is one of the uC's used, not sure which version this is for (V or VB)
@nor0x
nor0x / shadow+cornerradius.swift
Created December 22, 2016 17:23
UICollectionViewCell -> Corner Radius AND Shadow
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
cell.contentView.layer.cornerRadius = 2.0
cell.contentView.layer.borderWidth = 1.0
cell.contentView.layer.borderColor = UIColor.clear.cgColor
cell.contentView.layer.masksToBounds = true;
cell.layer.shadowColor = UIColor.lightGray.cgColor
cell.layer.shadowOffset = CGSize(width:0,height: 2.0)
cell.layer.shadowRadius = 2.0
cell.layer.shadowOpacity = 1.0
//: Playground - noun: a place where people can play
//: Binary gap solution for https://codility.com/programmers/task/binary_gap/
import UIKit
// use unsigned
func binary_gap(_ number: UInt) -> UInt {
var max_gap: UInt = 0
var current_gap: UInt = 0