Skip to content

Instantly share code, notes, and snippets.

View hectorddmx's full-sized avatar

Hector De Diego hectorddmx

View GitHub Profile
@hectorddmx
hectorddmx / CustomTabBar.swift
Created September 14, 2021 20:00
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)
@hectorddmx
hectorddmx / compile_openvpn_2_5_2_staticly.sh
Last active June 28, 2021 20:44
macos catalina, compile openvpn 2.5.2 staticly
#!/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
@hectorddmx
hectorddmx / failed_youtube_mobile_autoplay_test.html
Last active January 29, 2021 04:35
Failed to make youtube embed player for mobile Safari in iOS to autoplay. It doesn't work. Posted here to save others some time...
<!---
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';
#import "ViewController.h"
#import <CoreImage/CoreImage.h>
#import <AVFoundation/AVFoundation.h>
@interface ViewController () {
}
@property (strong, nonatomic) CIContext *coreImageContext;
@property (strong, nonatomic) AVCaptureSession *cameraSession;
@hectorddmx
hectorddmx / Disable iOS Simulator Incoming Connections Popup.sh
Created September 9, 2020 16:15 — forked from TomSoderling/Disable iOS Simulator Incoming Connections Popup.sh
Bash script for turning off the iOS simulator pop-up message
#!/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
@hectorddmx
hectorddmx / TVShowTableViewCell.swift
Last active February 19, 2020 04:55
TableView example with canceled data task
//
// TVShowTableViewCell.swift
// TVShows
//
// Created by Hector de Diego on 2/22/19.
// Copyright © 2019 hector.dd. All rights reserved.
//
import UIKit
@hectorddmx
hectorddmx / All.swift
Created October 18, 2019 17:30
Custom UITextfield with picker
//: A UIKit based Playground for presenting user interface
import UIKit
import PlaygroundSupport
class CustomTextField: UITextField {
weak var presenter: UIViewController!
override func becomeFirstResponder() -> Bool {
@hectorddmx
hectorddmx / All.swift
Created October 18, 2019 17:30
Custom UITextfield with picker
//: A UIKit based Playground for presenting user interface
import UIKit
import PlaygroundSupport
class CustomTextField: UITextField {
weak var presenter: UIViewController!
override func becomeFirstResponder() -> Bool {
@hectorddmx
hectorddmx / fix_cocoapods_catalina.sh
Last active October 25, 2023 16:39
Remove homebrew cocoapods installation in catalina, and install directly from gem, zsh version
#! /bin/zsh
install_cocoapods () {
echo "Installing cocoapods with gem"
# Creating new gems home if it doesnt't exist
if [ ! -d "$HOME/.gem" ]; then
mkdir "$HOME/.gem"
fi
# Adding to current session
javascript: (function () {
const demoClasses = document.querySelectorAll('.taskboard-row-summary');
demoClasses.forEach(element => {
element.classList.toggle('hidden');
});
}());