Skip to content

Instantly share code, notes, and snippets.

@cloudcreatordotio
cloudcreatordotio / dotnet-cli.md
Created August 20, 2026 01:05
DOTNET Cli Markdown

Here is a comprehensive .NET CLI cheat sheet formatted cleanly in Markdown. If you are just getting started, you might want to learn how to install the .NET SDK first, or explore how to use .NET CLI in CI/CD pipelines to automate your builds. .NET CLI Cheat Sheet ℹ️ Environment & Diagnostics

Command Description
Display the active .NET SDK version.
Display detailed environment information (OS, architecture, runtimes).
List all installed .NET SDK versions.
@cloudcreatordotio
cloudcreatordotio / install-toolbox.sh
Created April 22, 2026 18:17
Linux bash script to download the latest version of Jetbrains toolbox and install it. Make the script executable (chmod +x) and move it to the ~/.local/bin directory. Run the command "install-toolbox" in a new terminal to begin installation
#!/usr/bin/env bash
set -euo pipefail
API_URL="https://data.services.jetbrains.com/products/releases?code=TBA&latest=true&type=release"
INSTALL_DIR="/opt/jetbrains-toolbox"
echo "Fetching latest Toolbox release info..."
ALL_URLS="$(curl -fsSL "$API_URL" | grep -oP '"link":\s*"\Khttps://download\.jetbrains\.com/toolbox/[^"]+\.tar\.gz')"
case "$(uname -m)" in
public static class HtmlTruncator
{
public static string LimitOnWordBoundary(string str, int maxLength, string ellipses = "...")
{
XmlDocument doc = new XmlDocument();
XmlParserContext context = new XmlParserContext(doc.NameTable, new XmlNamespaceManager(doc.NameTable), null, XmlSpace.Preserve);
XmlTextReader reader = new XmlTextReader("<xml>" + str + "</xml>", XmlNodeType.Document, context);
bool shouldWriteEllipses;
@cloudcreatordotio
cloudcreatordotio / ImageUtil.cs
Created April 19, 2024 11:59 — forked from gsscoder/ImageUtil.cs
C# image utilities
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.IO;
public static class ImageUtil
{
public static Image Resize(this Image image, int width, int height)
{
var destRect = new Rectangle(0, 0, width, height);
@cloudcreatordotio
cloudcreatordotio / index.html
Created July 24, 2022 04:16 — forked from oliveratgithub/index.html
Simple, quick & standalone HTML5 responsive placeholder Website. Runs by simply copy-paste the whole code without any additional resource files. It's based on PureCSS.io with jQuery containing a fullstretch-background image plugin and a date-time countdown; kudos to unsplash.it for beautiful placeholder images.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Dummy Page</title>
<meta name="description" content="Simple, quick, standalone responsive placeholder Website without any additional resources">
<meta name="author" content="https://gist.github.com/oliveratgithub">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://unpkg.com/purecss@1.0.0/build/pure-min.css" integrity="sha384-nn4HPE8lTHyVtfCBi5yW9d20FjT8BJwUXyWZT9InLYax14RDjBj46LmSztkmNP9w" crossorigin="anonymous">
<!--[if lt IE 9]>
@cloudcreatordotio
cloudcreatordotio / function.php
Created May 30, 2020 15:39 — forked from hlashbrooke/function.php
WordPress: Check if user role exists
function role_exists( $role ) {
if( ! empty( $role ) ) {
return $GLOBALS['wp_roles']->is_role( $role );
}
return false;
}
@cloudcreatordotio
cloudcreatordotio / splat.rb
Created February 19, 2020 02:00 — forked from earlonrails/splat.rb
Iterm function which will create multiple tabs in a grid or vertical panes and execute the command or commands passed to it. ie. splat "ping google.com" "ping cnn.com" "ping twitter.com" "ping yahoo.com"
#!/usr/local/bin/ruby
require 'shellwords'
args = ARGV
size = args.size
tab_open = 'tell i term application "System Events" to keystroke "t" using {command down}'
v_pane_open = 'tell i term application "System Events" to keystroke "d" using {command down}'
h_pane_open = 'tell i term application "System Events" to keystroke "d" using {command down, shift down}'
go_left_one_pane = 'tell i term application "System Events" to key code 123 using {command down, option down}'
script_builder = Proc.new do |tell, command|
@cloudcreatordotio
cloudcreatordotio / git-cheat-sheet.md
Last active August 4, 2022 20:08
Cheat Sheet for Common Git commands
@cloudcreatordotio
cloudcreatordotio / untrack_DS_Store_files.sh
Last active February 4, 2020 22:07
Ignore all .DS_Store files in Git
#!/bin/bash
touch ~/.gitignore_global_config
echo ".DS_Store" >> ~/.gitignore_global_config
echo "._.DS_Store" >> ~/.gitignore_global_config
echo "**/.DS_Store" >> ~/.gitignore_global_config
echo "**/._.DS_Store" >> ~/.gitignore_global_config
git config --global core.excludesfile ~/.gitignore_global_config
@cloudcreatordotio
cloudcreatordotio / php-pools.md
Created November 18, 2019 22:12 — forked from holmberd/php-pools.md
Adjusting child processes for PHP-FPM (Nginx)

Adjusting child processes for PHP-FPM (Nginx)

When setting these options consider the following:

  • How long is your average request?
  • What is the maximum number of simultaneous visitors the site(s) get?
  • How much memory on average does each child process consume?

Determine if the max_children limit has been reached.

  • sudo grep max_children /var/log/php?.?-fpm.log.1 /var/log/php?.?-fpm.log