Skip to content

Instantly share code, notes, and snippets.

View joe-oli's full-sized avatar
💭
what the flock? no status to report, i am not a facebook junkie.

joe-oli

💭
what the flock? no status to report, i am not a facebook junkie.
View GitHub Profile
@joe-oli
joe-oli / Artificial-intelligence.md
Last active February 9, 2025 04:15
Artificial intelligence URL's
# Node.js dependencies
/node_modules/
/ui/node_modules/
/ui/client/node_modules/
# Build outputs
/dist/
/ui/client/build/
/ui/client/.next/
/out/
@joe-oli
joe-oli / rename.bat
Created October 27, 2024 01:01
Batch file to rename folders This.Is.My.Folder.(2024) Will be renamed "This Is My Folder (2024)" i.e. remove the dots
@echo off
setlocal enabledelayedexpansion
for /d %%F in (*.*) do (
set "folder=%%F"
set "newfolder=!folder:.= !"
ren "%%F" "!newfolder!"
)
@joe-oli
joe-oli / WizardUI-state.jsx
Created August 28, 2024 10:50
Wizard or multi-step interface
//using state management
import { useState } from 'react';
const Wizard = () => {
const [step, setStep] = useState(1);
const nextStep = () => setStep(prev => prev + 1);
const prevStep = () => setStep(prev => prev - 1);
return (
@joe-oli
joe-oli / ffmpeg-streaming.sh
Created July 6, 2024 03:07
stream with ffmpeg - view with VLC
# Add a packet size on both server (ffmpeg) and client (vlc) sides;
# in ffmpeg:
ffmpeg -re -i "path/to/my/video.mp4" -vcodec libx264 -f mpegts udp://127.0.0.1:1234?pkt_size=1316
# in vlc:
udp://127.0.0.1:1234?pkt_size=1316
When you initialize a new Git repository with `git init`, Git creates a single branch named `master` by default. This is the branch where your initial commit will go when you make it.
However, starting from Git 2.28, you can customize this behavior using the `init.defaultBranch` configuration option. For example, if you want your default branch to be named `main`, you can set this option globally with the following command:
```bash
git config --global init.defaultBranch main
```
After running this command, new repositories you create with `git init` will have a single branch named `main` by default.
@joe-oli
joe-oli / Extract-Exceptions.txt
Created February 2, 2024 17:31
Extract All exception messages
catch (Exception ex)
{
tbOutput.Text = GetExceptionMessages(ex);
}
...
private string GetExceptionMessages(Exception ex)
{
var message = ex.Message;
@joe-oli
joe-oli / Hourglass-WPF.cs
Last active February 1, 2024 09:08
Hourglass in WPF
private void Button_Click(object sender, RoutedEventArgs e)
{
// Change the cursor to an hourglass
Mouse.OverrideCursor = Cursors.Wait;
try
{
// Perform the long-running operation here
// ...
@joe-oli
joe-oli / Basic-XAML
Created January 18, 2024 03:36
Basic WPF Xaml
<Window x:Class="WpfApp.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<StackPanel>
<Expander Header="Expander 1">
<UniformGrid Rows="2" Columns="2">
<Button Content="Button 1"/>
<Button Content="Button 2"/>
<Button Content="Button 3"/>
@joe-oli
joe-oli / Git-Clone.sh
Created January 3, 2024 16:33
Git Clone Single Branch Only
# change to the folder where you want to create newBranchName
git clone --single-branch --branch features/upgrade ^
C:\Projects\DevOps\MyRepoName newBranchName
# C:\Projects\DevOps\MyRepoName is the repo where the branch you want to clone resides in;
# newBranchName is relative to current folder;