Skip to content

Instantly share code, notes, and snippets.

View m-etka's full-sized avatar

Etka Özdemir m-etka

  • HerkesePet
  • Antalya, Turkey
View GitHub Profile
@m-etka
m-etka / Basic HTML 5 Template
Created September 18, 2016 14:34
html_5_template.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>The HTML5 Herald</title>
<meta name="description" content="The HTML5 Herald">
<meta name="author" content="SitePoint">
@m-etka
m-etka / filenames.swift
Created June 27, 2016 10:53
Iterate file names in iOS documents directory.
// Get documents directory
let paths = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)
let documentsDirectory = paths[0]
// Create enumerator
let fileManager = NSFileManager.defaultManager()
let enumerator:NSDirectoryEnumerator = fileManager.enumeratorAtPath(documentsDirectory as String)!
// Iterate files
while let element = enumerator.nextObject() as? String {
@m-etka
m-etka / threads.swift
Last active July 29, 2016 09:12
Background Threads in Swift
// Special thanks to thatthinginswift.com (https://thatthinginswift.com/background-threads/)
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), {
// do some task
dispatch_async(dispatch_get_main_queue(), {
// update some UI
});
});
aView.layer.shadowColor = [UIColor blackColor].CGColor;
aView.layer.shadowOpacity = 0.7f;
aView.layer.shadowOffset = CGSizeMake(0.0f, 0.0f);
aView.layer.shadowRadius = 5.0f;
aView.layer.masksToBounds = NO;
UIBezierPath *path = [UIBezierPath bezierPathWithRect:aView.bounds];
aView.layer.shadowPath = path.CGPath;