Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Hector De Diego lecksfrawen

🎯
Focusing
View GitHub Profile
@lecksfrawen
lecksfrawen / migrate_to_github_huge_files.sh
Last active Mar 16, 2022
Migrate self hosted repo with files bigger than 100 MB to github via git lfs
View migrate_to_github_huge_files.sh
#!/bin/zsh
# Configure
CURRENT_ORG=SAMPLE_ORG
CURRENT_REPO=${PWD##*/}
# Track, fetch and pull all branches from previous host
git branch -r | grep -v '\->' | sed "s,\x1B\[[0-9;]*[a-zA-Z],,g" | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --all
@lecksfrawen
lecksfrawen / iOS, Swift, Objective-C resources.md
Last active May 9, 2022
iOS, Swift, Objective-C resources
View iOS, Swift, Objective-C resources.md

iOS, Swift, Objective-C resources

#ios #swift #objective-c #objc #obj-c #articles #tutorials #resources #tools #blogs #apps #services #books #courses

For a beginner that’s starting from scratch, I currently recommend HackingWithSwift since it’s free and it has a structured learning path. I’ve seen some juniors start successfuly with SwiftUI first which is easier for them and then go deep with UIKit.

View CustomTabBar.swift
class HomeTabBar: UITabBar {
// Other code here...
override func draw(_ rect: CGRect) {
// self.paintHitBox()
self.addShape()
}
override func point(inside point: CGPoint, with event: UIEvent?) -> Bool {
let normalBox = super.point(inside: point, with: event)
@lecksfrawen
lecksfrawen / compile_openvpn_2_5_2_staticly.sh
Last active Jun 28, 2021
macos catalina, compile openvpn 2.5.2 staticly
View compile_openvpn_2_5_2_staticly.sh
#!/bin/zsh
# https://gist.github.com/lecksfrawen/fab1a1690ab7b80b4acac617cb5be403
export OTHER_CODE_SIGN_FLAGS=--options=runtime
export OPENVPN_COMPILE_PATH=$HOME/openvpn_source
# Uncomment this if you'd like to clean up the folders before compiling
if [[ -d $OPENVPN_COMPILE_PATH ]] ; then
rm -rf $OPENVPN_COMPILE_PATH
@lecksfrawen
lecksfrawen / failed_youtube_mobile_autoplay_test.html
Last active Jan 29, 2021
Failed to make youtube embed player for mobile Safari in iOS to autoplay. It doesn't work. Posted here to save others some time...
View failed_youtube_mobile_autoplay_test.html
<!---
2021-01-28
Should load youtube videos automatically on mobile for work page.
Doesn't work with scripted playback, more on this here:
https://developers.google.com/youtube/iframe_api_reference?hl=tr
-->
<script type="text/javascript">
var tag = document.createElement('script');
tag.id = 'iframe-demo';
tag.src = 'https://www.youtube.com/iframe_api';
View camera-with-effects.m
#import "ViewController.h"
#import <CoreImage/CoreImage.h>
#import <AVFoundation/AVFoundation.h>
@interface ViewController () {
}
@property (strong, nonatomic) CIContext *coreImageContext;
@property (strong, nonatomic) AVCaptureSession *cameraSession;
View Disable iOS Simulator Incoming Connections Popup.sh
#!/bin/bash
# Script to disable the iOS Simulator app from showing the "Do you want the application xxxx to accept incoming network connections?" pop-up every time the app is run
echo "> Enter password to temporarily shut firewall off"
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off
echo "> Add Xcode as a firewall exception"
/usr/libexec/ApplicationFirewall/socketfilterfw --add /Applications/Xcode.app/Contents/MacOS/Xcode
@lecksfrawen
lecksfrawen / TVShowTableViewCell.swift
Last active Feb 19, 2020
TableView example with canceled data task
View TVShowTableViewCell.swift
//
// TVShowTableViewCell.swift
// TVShows
//
// Created by Hector de Diego on 2/22/19.
// Copyright © 2019 hector.dd. All rights reserved.
//
import UIKit