Skip to content

Instantly share code, notes, and snippets.

Limon Limon-O-O

Block or report user

Report or block Limon-O-O

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Limon-O-O
Limon-O-O / CocoapodsModule.ruby
Created Nov 16, 2017
Cocoapods Support Module
View CocoapodsModule.ruby
def generate_modulemap(name, path)
f = File.new(File.join("#{path}/module.modulemap"), "w+")
module_name = "#{name}"
while(module_name["+"])
module_name["+"] = "_"
end
f.puts("module XB#{module_name} {")
f.puts(" umbrella header \"#{name}_umbrella.h\"")
f.puts(" export *")
f.puts("}")
@Limon-O-O
Limon-O-O / README.md
Created Aug 17, 2017 — forked from ZenLulz/README.md
Install Oh-My-Zsh + iTerm2 with Solarized + System-wide console in 2017 (macOS)
View README.md

Install iTerm2 with Solarized in 2017

Here is the looks and feel of your terminal once the tutorial has been applied on your system:

Install iTerm2

Using Homebrew:

@Limon-O-O
Limon-O-O / release.sh
Created Feb 28, 2017
Release Pod script.
View release.sh
#!/bin/bash
BGreen='\033[1;32m'
Default='\033[0;m'
podName=""
version=""
podspecFilePath=""
homepage=""
httpsRepo=""
@Limon-O-O
Limon-O-O / version_compare.sh
Created Feb 18, 2017
Compare versions in Bash
View version_compare.sh
#!/bin/bash
# -*- tab-width: 2; encoding: utf-8 -*-
## @file version_compare
## Compare [semantic] versions in Bash, comparable to PHP's version_compare function.
# ------------------------------------------------------------------
## @author Mark Carver <mark.carver@me.com>
## @copyright MIT
## @version 1.0.0
## @see http://php.net/manual/en/function.version-compare.php
@Limon-O-O
Limon-O-O / update_version.sh
Last active Feb 27, 2017
Script for Incrementing Version Numbers
View update_version.sh
#!/bin/bash
# Link: <https://gist.github.com/jellybeansoup/db7b24fb4c7ed44030f4>
# ./update-version.sh --version=1.2.9 --build=95 --target=MonkeyKing
# We use PlistBuddy to handle the Info.plist values. Here we define where it lives.
plistBuddy="/usr/libexec/PlistBuddy"
BGreen='\033[1;32m'
# Parse input variables and update settings.
View releasePod.sh
#!/bin/bash
BGreen='\033[1;32m'
Default='\033[0;m'
podName=""
version=""
podspecFilePath=""
homepage=""
httpsRepo=""
@Limon-O-O
Limon-O-O / ATS.swift
Created Nov 27, 2016
Disables ATS in debug builds
View ATS.swift
#Disables ATS in debug builds.
INFOPLIST="${TARGET_BUILD_DIR}"/"${INFOPLIST_PATH}"
case "${CONFIGURATION}" in
"Release"|"Adhoc")
/usr/libexec/PlistBuddy -c "Set :NSAppTransportSecurity:NSAllowsArbitraryLoads NO" "${INFOPLIST}"
;;
"Debug")
/usr/libexec/PlistBuddy -c "Set :NSAppTransportSecurity:NSAllowsArbitraryLoads YES" "${INFOPLIST}"
;;
esac
@Limon-O-O
Limon-O-O / BrightnessValue.swift
Created Nov 9, 2016
get brightness value from CMSampleBuffer
View BrightnessValue.swift
func getBrightnessValue(from sampleBuffer: CMSampleBuffer) -> Float {
guard
let metadataDict = CMCopyDictionaryOfAttachments(nil, sampleBuffer, kCMAttachmentMode_ShouldPropagate) as? [String: Any],
let exifMetadata = metadataDict[String(kCGImagePropertyExifDictionary)] as? [String: Any],
let brightnessValue = exifMetadata[String(kCGImagePropertyExifBrightnessValue)] as? Float
else { return 0.0 }
return brightnessValue
}
View StructExtension.swift
import AVFoundation
public typealias AOIBaseType = AOIBaseProtocol
public protocol AOIBaseProtocol {
associatedtype T
var aoi: T { get }
static var aoi: T.Type { get }
}
@Limon-O-O
Limon-O-O / AVCaptureDevice+FrameRate.swift
Created Oct 31, 2016
Control video frame rate with AVFoundation
View AVCaptureDevice+FrameRate.swift
extension AVCaptureDevice {
/// http://stackoverflow.com/questions/21612191/set-a-custom-avframeraterange-for-an-avcapturesession#27566730
func configureDesiredFrameRate(_ desiredFrameRate: Int) {
var isFPSSupported = false
do {
if let videoSupportedFrameRateRanges = activeFormat.videoSupportedFrameRateRanges as? [AVFrameRateRange] {
You can’t perform that action at this time.