This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check if the stashed files with swiftformat before commiting. | |
# | |
# Installation: | |
# - Run the following command from your git root: | |
# `curl https://gist.githubusercontent.com/fousa/bf38ab0d3e0a0cd5ce1752c5c4932038/raw/ce9d02c9038e9f9b4b542a65f16fb94fb2ab352a/pre-commit > .git/hooks/pre-commit` | |
# - Set hook as executable: | |
# `chmod +x .git/hooks/pre-commit` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FairPlayer: AVPlayer { | |
private let queue = DispatchQueue(label: "com.icapps.fairplay.queue") | |
func play(asset: AVURLAsset) { | |
// Set the resource loader delegate to this class. The `resourceLoader`'s delegate will be | |
// triggered when FairPlay handling is required. | |
asset.resourceLoader.setDelegate(self, queue: queue) | |
// Load the asset in the player. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
included: | |
- Application Target Folder | |
- Tests Target Folder | |
disabled_rules: | |
- line_length | |
- trailing_whitespace | |
- function_body_length | |
- type_body_length | |
- file_length | |
- valid_docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/ruby | |
# You should pass the dSYM path from the dSYM file you | |
# want to lookup the UUID from. | |
unless ARGV.count == 1 | |
puts '!!! You should pass the dSYM path in order to lookup the UUID.' | |
exit | |
end | |
dsym_path = ARGV.first |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo | |
echo "*************************************************************************" | |
echo "** **" | |
echo "** Stop iTunes from launching when connecting a bluetooth headset. **" | |
echo "** **" | |
echo "*************************************************************************" | |
echo "** **" | |
echo "** -> Renaming the iTunes application to iMelodies. **" | |
sudo mv /Applications/iTunes.app /Applications/iMelodies.app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo "Testing" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'mina/bundler' | |
require 'mina/rails' | |
require 'mina/git' | |
require 'mina/rvm' | |
require 'mina_sidekiq/tasks' | |
set :rails_env, 'production' | |
set :domain, 'YOUR_IP_OR_DOMAIN' | |
set :deploy_to, "/home/rails/#{rails_env}" | |
set :repository, '[email protected]:fousa/<YOUR_REPOSITORY>.git' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef void(^MyBlock)(void); | |
MyBlock savedBlock = ^ { | |
// Executed block | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSUInteger index = 999; | |
NSData *payload = [NSData dataWithBytes:&index length:sizeof(index)]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSMutableDictionary *userInfo = [NSMutableDictionary dictionary]; | |
[userInfo setObject:@"You are not authenticated." forKey:NSLocalizedDescriptionKey]; | |
NSError *error = [NSError errorWithDomain:@"mydomain" code:0 userInfo:userInfo]; |
NewerOlder