Skip to content

Instantly share code, notes, and snippets.

View fredimachado's full-sized avatar

Fredi Machado fredimachado

View GitHub Profile
@fredimachado
fredimachado / Microsoft.PowerShell_profile.ps1
Created October 20, 2021 01:53
My Microsoft.PowerShell_profile.ps1
$global:DefaultUser = 'Fredi'
if ($host.Name -eq 'ConsoleHost')
{
Import-Module PSReadLine
}
Import-Module Terminal-Icons
Import-Module oh-my-posh
Set-PoshPrompt -Theme ~/myparadox.omp.json
@fredimachado
fredimachado / Rename-Fornite-Replays.ps1
Last active November 14, 2018 11:27
Rename Fortnite replay files removing the 'fixed-' prefix(es)
# !! USE IT AT YOUR OWN RISK !!
#
# Run this script after Fixing the replay files and deleting duplicate ones
# This script will remove the `fixed-` prefix(es) from the files
# NOTE: If you run this before fixing and deleting duplicate files you will get erros due to duplicate files
#
# Script to fix replay files: https://gist.github.com/fredimachado/19a489f6dccdb9e2d18b482bed87059d
# Script to delete duplicate replay files: https://gist.github.com/fredimachado/1a3d36f34e786a423328a347ff11215a
#
# Copy all this content, paste in notepad and save as a ps1 file, example: Rename-Fornite-Replays.ps1
@fredimachado
fredimachado / Delete-Duplicate-Fortnite-Replays.ps1
Last active November 14, 2018 11:04
Delete duplicate Fortnite replay files based on the date on the file name
# !! USE IT AT YOUR OWN RISK !!
#
# Run this script after Fixing the replay files and making sure you can watch them in the game
# This script will delete duplicate replay files based on the date on the name of the file
#
# Script to fix replay files: https://gist.github.com/fredimachado/19a489f6dccdb9e2d18b482bed87059d
#
# Copy all this content, paste in notepad and save as a ps1 file, example: Delete-Duplicate-Fortnite-Replays.ps1
# Then, open the folder containing the script, right click it and choose: Run With Powershell
# If it doesnt run, follow this: https://superuser.com/questions/106360/how-to-enable-execution-of-powershell-scripts
@fredimachado
fredimachado / Fix-Fornite-Replays.ps1
Last active December 7, 2022 05:51
Fix/Convert Fortnite Replays to 8.30
# Big thanks to the original creator of this script, IamLukeVice: https://www.reddit.com/user/IamLukeVice
#
# Copy all this content, paste in notepad and save as a ps1 file, example: Fix-Fornite-Replays.ps1
# Then, open the folder containing the script, right click it and choose: Run With Powershell
# If it doesnt run, follow this: https://superuser.com/questions/106360/how-to-enable-execution-of-powershell-scripts
#
# Script to delete duplicate replay files: https://gist.github.com/fredimachado/1a3d36f34e786a423328a347ff11215a
$LocalAppDataFolder = "$env:LOCALAPPDATA"
$FortniteReplaysFolder = $LocalAppDataFolder + "\FortniteGame\Saved\Demos"
$count = 0
@fredimachado
fredimachado / VertexColor.shader
Last active October 4, 2017 00:59
Coloring each triangle using vertex colors
Shader "Custom/Vertex Color"
{
CGINCLUDE
#include "UnityCG.cginc"
#include "AutoLight.cginc"
#include "Lighting.cginc"
ENDCG
SubShader
{
@fredimachado
fredimachado / field.snippet
Created July 3, 2017 05:14
Visual Studio snippet to create a Unity serializable field
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>field</Title>
<Shortcut>field</Shortcut>
<Description>Code snippet for a Unity serializable field
Language Version: C# 3.0 or higher</Description>
<Author>Fredi Machado</Author>
<SnippetTypes>
@fredimachado
fredimachado / DisableTouchConversionToMouse.cs
Last active December 18, 2023 21:23 — forked from ulatekh/DisableTouchConversionToMouse.cs
Globally disables the conversion of touch events to mouse events in Windows 10 but forwards button clicks
// Based on ulatekh's code: https://gist.github.com/ulatekh/f37b1a973c7a1b09f18a457e3a4af54a
// I wanted to keep the funcionality but allow button clicks on the touch screen monitor,
// that way the main user can start a custumer feedback window in the touch screen and be able
// to keep working in the main screen without interference from the touch screen.
namespace BlackFox
{
using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Security;
diff --git a/Formulas.cs b/Formulas.cs
index f65d65c..fabc88b 100644
--- a/Formulas.cs
+++ b/Formulas.cs
@@ -372,6 +372,44 @@ namespace OpcodeTools
{
return ((opcode & 0x8000) >> 13) | ((opcode & 0x80) >> 7) | ((opcode & 0x800) >> 10);
}
+ }
+
@fredimachado
fredimachado / gist:1636773
Created January 19, 2012 00:36
4.2.2 14545
// Handler: 6C7260 - http://paste2.org/p/1874034
[Parser(Opcode.TEST_422_13022, ClientVersionBuild.V4_2_2_14545)]
public static void Handle13022(Packet packet)
{
var bytes = new byte[8];
bytes[0] = (byte)(packet.ReadBit() ? 1 : 0);
bytes[4] = (byte)(packet.ReadBit() ? 1 : 0);
bytes[5] = (byte)(packet.ReadBit() ? 1 : 0);
bytes[1] = (byte)(packet.ReadBit() ? 1 : 0);