Skip to content

Instantly share code, notes, and snippets.

Jelle Vandebeeck fousa

Block or report user

Report or block fousa

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
@fousa
fousa / FairPlayer.swift
Last active Sep 4, 2019
Integrate HLS with FairPlay.
View FairPlayer.swift
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.
@fousa
fousa / .swiftlint.yml
Created Jan 3, 2017
Our current Swiftlint configuration file.
View .swiftlint.yml
included:
- Application Target Folder
- Tests Target Folder
disabled_rules:
- line_length
- trailing_whitespace
- function_body_length
- type_body_length
- file_length
- valid_docs
@fousa
fousa / get_uuid_from_dsym.rb
Created Jan 29, 2015
Get the UUID from your dSYM.
View get_uuid_from_dsym.rb
#! /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
@fousa
fousa / remove_itunes.sh
Last active Aug 29, 2015
Stop iTunes from launching when connecting a bluetooth headset
View remove_itunes.sh
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
@fousa
fousa / deploy.rb
Last active Jan 29, 2016
Deploy with mina on DigitalOcean server.
View deploy.rb
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, 'git@github.com:fousa/<YOUR_REPOSITORY>.git'
@fousa
fousa / content.m
Created Jul 25, 2012
Obj-C Save Block
View content.m
typedef void(^MyBlock)(void);
MyBlock savedBlock = ^ {
// Executed block
};
@fousa
fousa / content.m
Created Jul 23, 2012
NSNumber to NSData
View content.m
NSUInteger index = 999;
NSData *payload = [NSData dataWithBytes:&index length:sizeof(index)];
@fousa
fousa / content.m
Created Jul 23, 2012
Localize NSError
View content.m
NSMutableDictionary *userInfo = [NSMutableDictionary dictionary];
[userInfo setObject:@"You are not authenticated." forKey:NSLocalizedDescriptionKey];
NSError *error = [NSError errorWithDomain:@"mydomain" code:0 userInfo:userInfo];
@fousa
fousa / content.m
Created Jul 18, 2012
AFNetworking Reachability
View content.m
AFHTTPClient *client = [[AFHTTPClient alloc] initWithBaseURL:[NSURL URLWithString:@"http://www.apple.com"]];
[client setReachabilityStatusChangeBlock:^(BOOL isNetworkReachable) {
NSLog(@"Reachable %i", isNetworkReachable);
}];
You can’t perform that action at this time.