Skip to content

Instantly share code, notes, and snippets.

View celsojr's full-sized avatar
🏠
Working from home

Celso Jr celsojr

🏠
Working from home
View GitHub Profile
@celsojr
celsojr / dotnet_update.sh
Created March 23, 2025 07:19
This script automates the installation of the latest .NET SDK for Linux (x64).
#!/bin/bash
# ==============================================================================
# Title: Install & Manage .NET SDK (Latest Version)
# Description: This script automates the installation of the latest .NET SDK
# for Linux (x64). It verifies, downloads, and extracts the
# latest version while keeping `global.json` updated.
# Author: Celso Jr
# GitHub: https://github.com/celsojr
# Version: 1.0
@celsojr
celsojr / index.html
Last active June 2, 2024 15:40
Simple colored triangle with html and css only. Just for fun imitating the CG api triangles.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Radial Gradient Triangle</title>
<style>
body {
margin: 0;
height: 100vh;
@celsojr
celsojr / Factorial.cs
Last active July 30, 2021 02:29
Factorial operation with csharp 8 in a functional style (no Tail Call, no TCO)
using System;
using static System.Console;
namespace Snippets
{
static class Program
{
static void Main()
{
static long Fact(long x)
@celsojr
celsojr / Await.cs
Last active August 5, 2021 21:22
Simple custom awaiter
using System;
using System.Threading.Tasks;
using System.Runtime.CompilerServices;
static class Program
{
static async Task Main()
{
Console.WriteLine("One second pls...");
@celsojr
celsojr / App.cs
Last active August 8, 2021 02:20
Small experiment with the parallel programming model and the thread-safe collection BlockingCollection
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Json;
using System.Text.Json;
@celsojr
celsojr / StoragePlans.cs
Last active November 26, 2021 07:30
A program that lists all available storage plans
using System;
long n = 8;
for (int i = 0; i < 60; i++)
{
var storage = n << i;
Console.WriteLine($"{storage.Amount()} {storage.Unit()}");
}
static class Extensions
@celsojr
celsojr / CK62 Layers.AHK
Last active August 8, 2020 13:08
Customize the CK62 keyboard. More infos here: https://www.youtube.com/watch?v=cWivLDI0DnU
SetCapsLockState, AlwaysOff
CapsLock & /::Up
CapsLock & SC15D::Down
CapsLock & SC138::Left
CapsLock & SC11D::Right
CapsLock & l::Home
CapsLock & .::End
CapsLock & ,::Delete
CapsLock & `;::PgUp
CapsLock & '::PgDn
@celsojr
celsojr / BeginSecureTransaction.snippet
Last active May 8, 2020 12:13
Begin secure transaction with MSSMS
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<_locDefinition xmlns="urn:locstudio">
<_locDefault _loc="locNone"/>
<_locTag _loc="locData">Title</_locTag>
<_locTag _loc="locData">Description</_locTag>
<_locTag _loc="locData">Author</_locTag>
<_locTag _loc="locData">ToolTip</_locTag>
</_locDefinition>
<CodeSnippet Format="1.0.0">
@celsojr
celsojr / RestoreDatabase.snippet
Last active May 8, 2020 23:52
Database restoration snippet for MSSMS
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<_locDefinition xmlns="urn:locstudio">
<_locDefault _loc="locNone"/>
<_locTag _loc="locData">Title</_locTag>
<_locTag _loc="locData">Description</_locTag>
<_locTag _loc="locData">Author</_locTag>
<_locTag _loc="locData">ToolTip</_locTag>
</_locDefinition>
<CodeSnippet Format="1.0.0">