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
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 <sean@iamseanmurphy.com>
@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
}