Skip to content

Instantly share code, notes, and snippets.

View falnatsheh's full-sized avatar

Feras Alnatsheh falnatsheh

View GitHub Profile
@Shehryar
Shehryar / aggregate-framework.sh
Created April 9, 2019 13:45
Fix for creating a fat framework using lipo in Xcode 10.2
#!/bin/sh
if [ -z "$XCODE_VERSION_CORRECT" ]
then
export SUDO_ASKPASS="${PROJECT_DIR}/../scripts/askpass.sh"
fi
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
# make sure the output directory exists
@robhrt7
robhrt7 / MySQL_5-7_macOS.md
Last active February 28, 2024 03:48 — forked from nrollr/MySQL_macOS_Sierra.md
Install MySQL 5.7 on macOS using Homebrew

This is a fork of original gist https://gist.github.com/nrollr/3f57fc15ded7dddddcc4e82fe137b58e, with slight changes on pointing to 5.7 version branch, instead of 8 (latest default of MySQL in Hombrew).

Install MySQL 5.7 on macOS

This procedure explains how to install MySQL using Homebrew on macOS (Sierra 10.12 and up)

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.
@lattner
lattner / TaskConcurrencyManifesto.md
Last active May 7, 2024 09:05
Swift Concurrency Manifesto
@noordawod
noordawod / KeyboardAwareUIViewController.swift
Last active September 6, 2019 20:00
Custom UIViewController that takes care of repositioning its view above a raised window. Written for Swift 3.0.
//
// The MIT License (MIT)
//
// Copyright (c) 2017 Noor Dawod (noor@fine47.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
@morishin
morishin / 1_playground.swift
Last active February 26, 2021 10:27
Circular UIView with drop shadow (using UIBezierPath)
import UIKit
import PlaygroundSupport
let container = UIView(frame: CGRect(x: 0, y: 0, width: 500, height: 200))
container.backgroundColor = .lightGray
let buttonRadius: CGFloat = 50
let buttonSize = CGSize(width: buttonRadius * 2, height: buttonRadius * 2)
let buttonPath = UIBezierPath(arcCenter: CGPoint(x: buttonRadius, y: buttonRadius), radius: buttonRadius, startAngle: 0, endAngle: CGFloat.pi * 2, clockwise: true)
@EyreFree
EyreFree / CIImage+.swift
Last active April 27, 2020 04:47
iOS CIImage Replace color with another one in Swift 3.1
import Foundation
struct EFUIntPixel {
var red: UInt8 = 0
var green: UInt8 = 0
var blue: UInt8 = 0
var alpha: UInt8 = 0
}
extension CIImage {
// UIImage+Downsample.swift
// Created by Todd Hopkinson
import UIKit
extension UIImage {
func downsample(reductionAmount: Float) -> UIImage? {
let image = UIKit.CIImage(image: self)
extension AVAsset {
func videoOrientation() -> (orientation: UIInterfaceOrientation, device: AVCaptureDevicePosition) {
var orientation: UIInterfaceOrientation = .Unknown
var device: AVCaptureDevicePosition = .Unspecified
let tracks :[AVAssetTrack] = self.tracksWithMediaType(AVMediaTypeVideo)
if let videoTrack = tracks.first {
let t = videoTrack.preferredTransform
@FrancoisBlavoet
FrancoisBlavoet / DiaporamaAdapter.java
Created March 30, 2015 22:09
Helper Class allowing to load multiple images consecutively in the same view with Glide and animate between them.
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.TransitionDrawable;
import android.support.annotation.DrawableRes;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.animation.AlphaAnimation;
@jamesdlacroix
jamesdlacroix / proposal-example.md
Last active October 15, 2023 19:46
Example markdown proposal to be used with Marked. For more information, check out the blog post on how we are using this to streamline our proposal writing. http://www.lacroixdesign.net/blog/streamlining-our-proposal-writing-process/

Title: Project Title Author: First Last Email: Email@Example.com Address: 1234 Street, City, State 12345 Phone: (XXX)XXX-XXXX Affiliation: www.LaCroixDesign.net Copyright: 2015 Company Name Keywords: Proposal, Web Design Date: March 13, 2015