Skip to content

Instantly share code, notes, and snippets.

View VonC's full-sized avatar

VonC VonC

View GitHub Profile
@VonC
VonC / 77248619.md
Created October 7, 2023 19:45
77248619 Swift + Swift UI - Fix bugs in TikTok clone on IOS app 'Hustles'

Based on the code snippets provided, it appears that your iOS application uses SwiftUI to create a TikTok-like user interface for playing YouTube videos. The videos are embedded within a WKWebView and the relevant UI components are built using SwiftUI.

Issue:

Screen flashes white then black as the video loads, and the desired outcome is to have the video cover show with a loading icon until the video is ready to play.

Proposed Solution

  1. Video Cover and Loading Indicator:
    • To display a loading indicator and a video cover, you can introduce a new SwiftUI View that overlays on top of your SingleVideoView. This overlay view can contain a loading indicator and an image view for displaying the video cover.
@VonC
VonC / 31871888.md
Last active October 2, 2023 18:34
31871888.md

Question

"git submodule update --init --recursive does not know exactly where to checkout the submodules"

okay, what am I missing?
Because at a glance, the obvious solution literally enabled by having multiple worktrees is to give each submodule a linked worktree in each of the parent repo's linked worktrees.

The notion of giving each submodule a linked worktree in each of the parent repository's linked worktrees is theoretically sound and would seem to provide a structured and organized solution. That arrangement could indeed mirror the structure of the parent repository's worktrees, providing a clean, hierarchical arrangement that keeps submodule work isolated within the scope of each parent worktree.

@VonC
VonC / bash_bc.md
Last active July 22, 2023 04:57
Sum with bash

If you are working in a bash-like environment such as Git Bash on Windows, you can use the built-in shell arithmetic expansion feature for calculating sums. That feature allows you to perform arithmetic operations within your shell script without using any external commands like bc.

A script like:

#!/bin/bash
# read each line from the file
while read line; do
  # evaluate the arithmetic expression in the line
 result=$((line))
@VonC
VonC / txt
Created May 29, 2023 14:26
gl deploy log
Running with gitlab-runner 16.1.0~beta.5.gf131a6a2 (f131a6a2)
 on green-1.shared.runners-manager.gitlab.com/default JLgUopmM, system ID: s_b9608e9d087b
 feature flags: FF_USE_IMPROVED_URL_MASKING:true
section_start:1685365795:prepare_executor
Preparing the "docker+machine" executor
Using Docker executor with image ubuntu:22.04 ...
Starting service registry.gitlab.com/sunnyatticsoftware/sandbox/mongo-rs:latest ...
Authenticating with credentials from job payload (GitLab Registry)
Pulling docker image registry.gitlab.com/sunnyatticsoftware/sandbox/mongo-rs:latest ...
Using docker image sha256:a572a87f1f5ae6c025e7226186f24b5db73aba24e4e1f2ed702af5318ba88619 for registry.gitlab.com/sunnyatticsoftware/sandbox/mongo-rs:latest with digest registry.gitlab.com/sunnyatticsoftware/sandbox/mongo-rs@sha256:fb00fe0dd92366182a3dadde57a6811348076489a4a6be9922ff5d89ea2c2815 ...
@VonC
VonC / git-mergetool-winmerge.md
Created May 15, 2023 12:14
How can WinMerge give me notification if there are still conflicts when I close it?

Yes, it's possible to configure WinMerge in a way that it will notify you if there are remaining conflicts when you close it, but it's not a built-in feature of WinMerge itself. The strategy here is to add some script in Git configuration that checks whether the merge made by WinMerge is indeed successful.

Here is a simple approach to achieve this:

  1. Use a custom script as your mergetool that calls WinMerge and then checks for remaining conflict markers (<<<<<<<, =======, >>>>>>>) in the file.

Create a file named winmerge-with-conflict-check.sh with the following content:

#!/bin/sh
@VonC
VonC / git-p4.txt
Created January 3, 2020 20:14
git-p4 diff 2012-2019
git-p4(1)
=========
NAME
----
git-p4 - Import from and submit to Perforce repositories
SYNOPSIS
--------
@VonC
VonC / testwrap.md
Created January 18, 2018 21:37
Test wrap md
return (
  <div className="App">
    <h1>Quantum Pilot</h1>
      <div className="content">
        <div className="box"><About/></div>
        <div className="box">HnnYoutube</div>
        <div className="box">{buy}</div>
        <div className="box">{mykeys}</div>
 
@VonC
VonC / jdkpkg.bat
Created August 3, 2016 19:00
Windows bat script packaging a jdk exe intaller into a simple zip archive
@echo off
SETLOCAL EnableDelayedExpansion
REM src: http://stackoverflow.com/questions/1619662/how-can-i-get-the-latest-jre-jdk-as-a-zip-file-rather-than-exe-or-msi-installe
REM src: http://stackoverflow.com/questions/10891405/installing-jdk-without-administrator-privileges/38511724#38511724
REM JDK8 http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
set v=%1
if "%v%" equ "" (
@VonC
VonC / vendor.bat
Last active May 16, 2016 16:12
Windows bat script to vendorize a github repo in a vendor subfolder of a go project
@echo off
setlocal enabledelayedexpansion
rem set pkg=github.com/jroimartin/gocui
set pkg=%1
if "%pkg%"=="" (
echo expect package name github.com/user/project
exit /b 1
)
if exist "vendor/%pkg%" (
echo '%pkg%' already vendorized
Verifying that +vonc__ is my blockchain ID. https://onename.com/vonc__