Skip to content

Instantly share code, notes, and snippets.

View anelad's full-sized avatar

Arda Oğul Üçpınar anelad

  • İzmir / Turkey
View GitHub Profile
//
// BottomSheetView.swift
//
// Created by Majid Jabrayilov
// Copyright © 2019 Majid Jabrayilov. All rights reserved.
//
import SwiftUI
fileprivate enum Constants {
static let radius: CGFloat = 16
@anelad
anelad / Swift_Commenting.md
Created April 10, 2024 15:55
in-line documentation in swift

Documentation Comment Syntax

Documentation comments in Swift use Markdown-flavored markup syntax. Swift doc comments utilize a full-fledged CommonMark parser library (known as [swift-cmark] in the Swift projects), which is rendered in Xcode QuickHelp.

Swift Markup syntax is exactly CommonMark, by design, not only for its

import Foundation
// Inspired by https://gist.github.com/mbuchetics/c9bc6c22033014aa0c550d3b4324411a
struct JSONCodingKeys: CodingKey {
var stringValue: String
init?(stringValue: String) {
self.stringValue = stringValue
}
@anelad
anelad / url_slug.js
Created July 1, 2019 11:51 — forked from sgmurphy/url_slug.js
URL Slugs in Javascript (with UTF-8 and Transliteration Support)
/**
* Create a web friendly URL slug from a string.
*
* Requires XRegExp (http://xregexp.com) with unicode add-ons for UTF-8 support.
*
* Although supported, transliteration is discouraged because
* 1) most web browsers support UTF-8 characters in URLs
* 2) transliteration causes a loss of information
*
* @author Sean Murphy <[email protected]>
@anelad
anelad / Laravel on VestaCP.md
Created April 10, 2019 15:55 — forked from peterbrinck/Laravel on VestaCP.md
Laravel web templates for VestaCP

I've made a new web template to make Laravel work easily on VestaCP, and so I wouldn't have to change my Laravel installation, if I ever wanted to deploy it elsewhere.

Each file should be put in /usr/local/vesta/data/templates/web/apache2

Then, when you edit your domain/site, you can change the web template to Laravel and just upload your whole project into public_html

/*
* Underscore
* Parse object to array
*/
_(obj).each(function(elem, key){
// console.log(elem);
// console.log(key);
obj[key] = _(elem).values();
@anelad
anelad / struct-CodingKeys
Created July 21, 2018 15:20 — forked from inamiy/struct-CodingKeys
Swift 4 Decodable + `struct CodingKeys`
import Foundation
struct User: Decodable {
let name: String
let age: Int?
// private enum CodingKeys: String, CodingKey {
// case name
// case NAME
// }
@anelad
anelad / UIView+Border.swift
Last active March 5, 2018 12:56 — forked from MrJackdaw/UIView+Border.swift
Swift 4 Extension for adding border to one side of UIView
// Ready for Swift 4
extension UIView {
// Example usage: myView.addBorder(toSide: .left, withColor: .red, andThickness: 1.0)
enum Side {
case left, right, top, bottom
}
@anelad
anelad / CanPerformSegue.swift
Created January 15, 2018 20:26
Swift 4 implementation for checking if segue with identifier exists.
import UIKit
extension UIViewController {
/**
Checks whether controller can perform specific segue or not.
- parameter identifier: Identifier of UIStoryboardSegue.
*/
func canPerformSegue(withIdentifier identifier: String) -> Bool {
//first fetch segue templates set in storyboard.

This code of conduct outlines our expectations for participants within the 'project' GitHub community, as well as steps to reporting unacceptable behavior. We are committed to providing a welcoming and inspiring community for all and expect our code of conduct to be honored. Anyone who violates this code of conduct may be banned from the community.

Our open source community strives to:

  • Be friendly and patient.
  • Be welcoming: We strive to be a community that welcomes and supports people of all backgrounds and identities. This includes, but is not limited to members of any race, ethnicity, culture, national origin, colour, immigration status, social and economic class, educational level, sex, sexual orientation, gender identity and expression, age, size, family status, political belief, religion, and mental and physical ability.
  • Be considerate: Your work will be used by other people, and you in turn will depend on the work of others. Any decision you take will affect users and colleagues, an