Skip to content

Instantly share code, notes, and snippets.

// https://forum.unity.com/threads/clear-old-texture-references-from-materials.318769/
#define UPDATING_FLOAT_TO_INT
#if UNITY_EDITOR
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
public class MaterialPropertyCleaner : EditorWindow {
private const float REMOVE_BUTTON_WIDTH = 60;
@JustinGrote
JustinGrote / Get-ScriptModules.ps1
Last active February 16, 2024 15:48
Find the module names for all commands used in a script
#requires -version 7
using namespace System.Management.Automation.Language
using namespace Collections.Generic.Queue
function Get-ScriptModules {
<#
.SCRIPTBLOCK
Given a script, returns a list of all the modules it uses.
#>
@JustinGrote
JustinGrote / GetAllPSGalleryPackages.ps1
Last active December 12, 2023 17:23
Get All Packages from the PowerShell Gallery
using namespace System.Management.Automation
using namespace System.Collections.Generic
[List[Job2]]$jobs = @()
[List[Object]]$Result = @()
$baseUri = 'https://www.powershellgallery.com/api/v2/Packages?$skip='
$maxPackages = 309000
for ($i = 0; $i -lt $maxPackages; $i += 100) {
@JustinGrote
JustinGrote / ConvertTo-Markdown.ps1
Created January 27, 2024 00:25
Convert PowerShell Objects to Markdown Display by screen-scraping Format-Table
using namespace System.Collections.Generic
using namespace Microsoft.PowerShell.Commands.Internal.Format
#Inspired by: https://gist.github.com/aaroncalderon/09a2833831c0f3a3bb57fe2224963942
<#
.Synopsis
Converts PowerShell Objects or Format-Table output to Markdown
#>
Function ConvertTo-Markdown {
[CmdletBinding()]
@SoabY
SoabY / JetBrains products Activation code until 15 May 2024
Created October 1, 2023 08:04
JetBrains products Activation code until 15 May 2024
8Z6IT0PIZH-eyJsaWNlbnNlSWQiOiI4WjZJVDBQSVpIIiwibGljZW5zZWVOYW1lIjoiSHVuYW4gTm9ybWFsIFVuaXZlcnNpdHkiLCJhc3NpZ25lZU5hbWUiOiJTdGFyayB6aGFuZyIsImFzc2lnbmVlRW1haWwiOiJzdGFyazE5ODUyMDIwQGdtYWlsLmNvbSIsImxpY2Vuc2VSZXN0cmljdGlvbiI6IkZvciBlZHVjYXRpb25hbCB1c2Ugb25seSIsImNoZWNrQ29uY3VycmVudFVzZSI6ZmFsc2UsInByb2R1Y3RzIjpbeyJjb2RlIjoiRFBOIiwicGFpZFVwVG8iOiIyMDI0LTA1LTE1IiwiZXh0ZW5kZWQiOmZhbHNlfSx7ImNvZGUiOiJEQiIsInBhaWRVcFRvIjoiMjAyNC0wNS0xNSIsImV4dGVuZGVkIjpmYWxzZX0seyJjb2RlIjoiUFMiLCJwYWlkVXBUbyI6IjIwMjQtMDUtMTUiLCJleHRlbmRlZCI6ZmFsc2V9LHsiY29kZSI6IklJIiwicGFpZFVwVG8iOiIyMDI0LTA1LTE1IiwiZXh0ZW5kZWQiOmZhbHNlfSx7ImNvZGUiOiJSU0MiLCJwYWlkVXBUbyI6IjIwMjQtMDUtMTUiLCJleHRlbmRlZCI6dHJ1ZX0seyJjb2RlIjoiR08iLCJwYWlkVXBUbyI6IjIwMjQtMDUtMTUiLCJleHRlbmRlZCI6ZmFsc2V9LHsiY29kZSI6IkRNIiwicGFpZFVwVG8iOiIyMDI0LTA1LTE1IiwiZXh0ZW5kZWQiOmZhbHNlfSx7ImNvZGUiOiJSU0YiLCJwYWlkVXBUbyI6IjIwMjQtMDUtMTUiLCJleHRlbmRlZCI6dHJ1ZX0seyJjb2RlIjoiRFMiLCJwYWlkVXBUbyI6IjIwMjQtMDUtMTUiLCJleHRlbmRlZCI6ZmFsc2V9LHsiY29kZSI6IlBDIiwicGFpZFVwVG8iOiIyMDI0LTA1LTE1IiwiZ
@hoandang
hoandang / php-docker-ext
Created May 20, 2017 01:12
Complete list of php docker ext
RUN apt update
RUN apt upgrade -y
RUN apt install -y apt-utils
RUN a2enmod rewrite
RUN apt install -y libmcrypt-dev
RUN docker-php-ext-install mcrypt
RUN apt install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
//Este metodo es obligatorio
public void start( Stage primaryStage ){
Group root = new Group();
//El grupo que se desea agregar, y el tamaño ancho y alto
Scene scene = new Scene( root, 300, 300 );
//Titulo de la ventana
primaryStage.setTitle("JavaFx");
//Se agrega la scena
primaryStage.setScene( scene );
@mzpqnxow
mzpqnxow / DiscordSOCKS5.md
Created August 24, 2020 04:45
Use SOCKS5 proxy with Discord on Linux

Using SOCKS5 Proxy With Discord on Linux

You may only need the environment or the command-line parameter to force Discord to use a proxy. It doesn't hurt to use both

So if you're behind a firewall and need to go through, e.g. an SSH dynamic port forward (a SOCKS5 channel inside an SSH session) you can use the following:

$ nohup ssh -D1080 proxy_server &
$ http_proxy=socks5://127.0.0.1:1080 https_proxy=socks5://127.0.0.1:1080 /opt/Discord/Discord --proxy-server="socks5://127.0.0.1:1080"
@ashmalvayani
ashmalvayani / download.sh
Created December 12, 2023 14:41
How to download data in parallel in TMUX
## how to execute the file
# chmod a+x filename.sh
# ./filename.sh
---------
#!/bin/bash
# Split window into panes and run wget in each pane
for i in $(seq -f "%03g" 0 120)

Image for Prep Photon OS for Photon Platform

Change password to never expire

chage –I -1 –m 0 –M 99999 –E -1 root

Update repository sources

tdnf update