Skip to content

Instantly share code, notes, and snippets.

View aaronlab's full-sized avatar
🛫

Aaron Lee aaronlab

🛫
View GitHub Profile
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
mr Marathi
bs Bosnian
ee_TG Ewe (Togo)
ms Malay
kam_KE Kamba (Kenya)
mt Maltese
ha Hausa
es_HN Spanish (Honduras)
ml_IN Malayalam (India)
ro_MD Romanian (Moldova)
@aaronlab
aaronlab / Podfile
Last active July 4, 2021 05:54
Podfile with cache
platform :ios, '12.0'
inhibit_all_warnings!
def is_pod_binary_cache_enabled
ENV['IS_POD_BINARY_CACHE_ENABLED'] == 'true'
end
if is_pod_binary_cache_enabled
plugin 'cocoapods-binary-cache'
config_cocoapods_binary_cache(
@aaronlab
aaronlab / UINavigationController+Ext.swift
Created April 6, 2021 08:49
UINavigationController Gesture Extension for the hidden navigation bar
extension UINavigationController: UIGestureRecognizerDelegate {
open override func viewDidLoad() {
super.viewDidLoad()
interactivePopGestureRecognizer?.delegate = self
}
}
@aaronlab
aaronlab / UIButton+Ext.swift
Last active April 5, 2021 14:54
UIButton Animation Extension Solution
import UIKit
// MARK: - Custom Button Gesture
extension UIButton {
/**
This part will let you use the system default animation for the UIButton,
when you use the custom UIButton class.
*/
@aaronlab
aaronlab / UIView+Extensions+Layout.swift
Last active April 5, 2021 14:08
UIView Extensions related to Layout
import UIKit
// MARK: - Auto Layout
extension UIView {
/// This is an extension function that sets up the view's anchor.
/// - Parameters:
/// - left: Super view's bottom anchor
@aaronlab
aaronlab / wait_for_db.py
Created March 14, 2021 08:55
Django: wait_for_db command
# https://docs.djangoproject.com/en/3.0/howto/custom-management-commands/
import time
from django.db import connections
from django.db.utils import OperationalError
from django.core.management.base import BaseCommand
class Command(BaseCommand):
@aaronlab
aaronlab / ChoosableSheet.swift
Created March 13, 2021 02:53
A view modifier to use '.sheet ' and '.fullScreenCover' at the same time
struct ChooseableSheet<Destination>: ViewModifier where Destination: View {
@Binding var isFullScreen: Bool
@Binding var isPresented: Bool
private let fullScreenContent: () -> Destination?
private let modalContent: () -> Destination?
init(
isFullScreen: Binding<Bool>,
isPresented: Binding<Bool>,
@aaronlab
aaronlab / DjangoDockerFile
Created March 2, 2021 13:01
DockerFile for Django
FROM python:3.7-alpine
MAINTAINER Aaron Lee
ENV PYTHONUNBUFFERED 1
COPY ./requirements.txt /requirements.txt
RUN pip install -r /requirements.txt
RUN mkdir /app
WORKDIR /app
@aaronlab
aaronlab / DjangoRequirements.txt
Created March 2, 2021 13:00
DJango + rest_framework
Django>=2.1.3,<2.2.0
djangorestframework>=3.9.0,<3.10.0
@aaronlab
aaronlab / Django_Vgrantfile
Created March 1, 2021 10:49
Vgrantfile for Django
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at