Skip to content

Instantly share code, notes, and snippets.

View josuesasilva's full-sized avatar

Josué Santos josuesasilva

View GitHub Profile
@josuesasilva
josuesasilva / Player.swift
Last active September 20, 2023 23:49
A sample implementation for AVAssetResourceLoaderDelegate
import AVKit
class VideoPlayer {
// ...
func start() {
requestURLAsset(for: src, cookies: cookies, delegate: self) { [weak self] asset in
@josuesasilva
josuesasilva / init.vim
Created February 7, 2021 12:59
Neovim + LanguageClient + ALE + Python + React Native
" Plugins management
call plug#begin(stdpath('data') . '/plugged')
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'dense-analysis/ale'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'autozimu/LanguageClient-neovim', {
@josuesasilva
josuesasilva / 0 - setup
Created November 9, 2020 19:02 — forked from aserhat/0 - setup
QEMU and HVF
# Summary
A few notes I took to see if I could use MacOS as Hypevirsor in a similar fashion to Linux
I wanted to see how few addons were needed instead of using Parallels, Virtual Box, VM Fsion etc.
The idea is to use QEMU, Hypervisor Framework (https://developer.apple.com/documentation/hypervisor) and some custom host networking.
# Installations
brew install qemu (For controlling Hypervisor Framework)
brew install cdrtools (For making cloud init iso's)
http://tuntaposx.sourceforge.net/download.xhtml (For customer tap based networking)
@josuesasilva
josuesasilva / .vimrc
Last active October 9, 2020 00:13
Vim configurations focused on Flutter env
" Plugins setup ---------- {{{
call plug#begin('~/.vim/plugged')
" Section: UI
" Description: In order to use devicons follow this documentation:
" https://github.com/ryanoasis/nerd-fonts#font-installation
"
Plug 'lucasprag/simpleblack'
Plug 'vim-airline/vim-airline'
@josuesasilva
josuesasilva / script.sh
Created July 13, 2020 19:57
Create temporary file in RAM memory
tmp=$(mktemp)
{
grep somedir INSTALLFILE
grep 'export PERL5LIB' INSTALLFILE
} > "$tmp"
. "$tmp"
@josuesasilva
josuesasilva / AsyncJob.swift
Created May 29, 2020 23:46
Running async operations with dependent functions
infix operator >>->>: LogicalConjunctionPrecedence
typealias AsyncJob = (@escaping () -> Void) -> Void
func >>->>(lhs: @escaping AsyncJob, rhs: @escaping AsyncJob) -> AsyncJob {
return { completion in
lhs {
rhs(completion)
}
}
}
@josuesasilva
josuesasilva / build.sh
Created May 25, 2020 01:56
Generate prebuilt React Native for iOS
#!/bin/sh
# Pods enviroment
PROJECT_NAME=Pods
PODS_WORKSPACE=ios/Pods/Pods.xcodeproj
PODS_SCHEME=React
PODS_HEADERS=ios/Pods/Headers/Public
# Xcode build system enviroment
DERIVED_DATA_PATH=build/DerivedData
@josuesasilva
josuesasilva / script.sh
Created May 10, 2020 21:38
Copying React Native prebuilt libraries and headers
WORKSPACE="../RNBuild"
HEADERS_SRCROOT=${SRCROOT}/Headers/Public
HEADERS_TARGETDIR=${WORKSPACE}/Headers
TARGET_DIR=${WORKSPACE}
mkdir -p ${TARGET_DIR}/{Simulator,Device,Headers,Universal}
find ${BUILD_DIR}/Debug-iphoneos -type f \( -iname "*.a" ! -iname "libPods*.a" \) -exec cp "{}" ${TARGET_DIR}/Simulator \;
find ${BUILD_DIR}/Debug-iphonesimulator -type f \( -iname "*.a" ! -iname "libPods*.a" \) -exec cp "{}" ${TARGET_DIR}/Device \;
@josuesasilva
josuesasilva / gist:ac20fc1768a0a5457d9e2787a4a2342d
Created February 10, 2020 17:16
Add debugger to iOS app built with Bazel 2.0.0 and Tulsi 0.20200115.88
// Just add this two flags in Tulsi settings to make breakpoints work.
// Open Tulsi, select "Shared Options" tab and put the flags in "'build' options" section
--strategy=SwiftCompile=standalone --apple_generate_dsym
@josuesasilva
josuesasilva / fig.png
Created July 11, 2019 15:14 — forked from morishin/left-align-stack-view.png
Align to Left the contents of UIStackView
fig.png