Skip to content

Instantly share code, notes, and snippets.

View jmelosegui's full-sized avatar

Juan M Elosegui jmelosegui

View GitHub Profile
@jmelosegui
jmelosegui / game-of-life.rs
Created August 29, 2026 16:55
Conway's Game of Life in Rust - terminal animation with glider and worker bee patterns
const COLS: i32 = 64;
const ROWS: i32 = 32;
fn main() {
print!("\x1b[?25l");
let mut canvas = vec![vec![false; COLS as usize]; ROWS as usize];
let patterns: [(&[(usize,usize)],(usize,usize)); 2] = [
// Glider
(&[(1,0),(2,1),(0,2),(1,2),(2,2)], (0,0)),
function Resolve-Error ($ErrorRecord=$Error[0])
{
$ErrorRecord | Format-List * -Force
$ErrorRecord.InvocationInfo | Format-List *
$Exception = $ErrorRecord.Exception
for ($i = 0; $Exception; $i++, ($Exception = $Exception.InnerException))
{ "$i" * 80
$Exception | Format-List * -Force
}
}
Add-Type -AssemblyName System.Configuration
$fileMap = New-Object -TypeName System.Configuration.ExeConfigurationFileMap
$fileMap.ExeConfigFilename = "app.config"
$configurationUserLevelNone = 0
$config = [System.Configuration.ConfigurationManager]::OpenMappedExeConfiguration($fileMap, $configurationUserLevelNone)
$section = $config.GetSection("connectionStrings");

Keybase proof

I hereby claim:

  • I am jmelosegui on github.
  • I am jmelosegui (https://keybase.io/jmelosegui) on keybase.
  • I have a public key ASBPD3i2zMDoyI7xTA5byIbkSPge4cb6TyinON7-JTg3KAo

To claim this, I am signing this object:

@jmelosegui
jmelosegui / RunPowershellOnStartUp
Created August 17, 2020 13:12
This command creates a schedule task to run a powershell script on system startup.
schtasks /create /tn "Start Docker Containers" /sc onstart /delay 0000:30 /rl highest /ru system /tr "powershell.exe -file E:\ScheduledTasks\StartDockerContainers.ps1"
$folderToDelete = "E:\d\"
takeown.exe /F $folderToDelete /R /A /D Y
icacls $folderToDelete /T /C /grant Administrators:F
Remove-Item $folderToDelete -Recurse -Force
rundll32 dfshim CleanOnlineAppCache
@jmelosegui
jmelosegui / Get-InstalledSoftware.ps1
Created January 10, 2019 16:53
Retrieves a list of all software installed you can filter by name or guid
function Get-InstalledSoftware
{
<#
.SYNOPSIS
Retrieves a list of all software installed
.EXAMPLE
Get-InstalledSoftware
This example retrieves all software installed on the local computer
.PARAMETER Name
@jmelosegui
jmelosegui / VideoToGif
Last active September 30, 2018 15:46
convert video into a gif using docker and ffmpeg
docker run --rm --volume ${pwd}:/ourtput jmelosegui/ffmpeg -i output/video.mp4 /output/video.gif
@jmelosegui
jmelosegui / vs-code.json
Created March 8, 2018 20:23
Settings to use commander as me console application with in vscode
"terminal.external.windowsExec": "C:\\dev\\utils\\cmder\\Cmder.exe",
"terminal.integrated.shell.windows": "C:\\WINDOWS\\sysnative\\cmd.exe",
"terminal.integrated.shellArgs.windows" : ["/K","C:\\dev\\utils\\cmder\\vendor\\init.bat"],