This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $json = Get-Content "$PSScriptRoot\unity_shaders_full_details.json" | ConvertFrom-Json | |
| $shaders = $json | Where-Object { $_.url -like "*/vfx/shaders/*" } | |
| $shadersByTagSortedByName = $shaders | ForEach-Object { $_.tags } | Group-Object | Select-Object Name, Count | Sort-Object Name | |
| $shadersByTagSortedByCount = $shaders | ForEach-Object { $_.tags } | Group-Object | Select-Object Name, Count | Sort-Object Count -Descending | |
| $shadersWithFiveStarts = $shaders | Where-Object { $_.metrics.rating -eq 5 -and $_.metrics.review_count -ge 10 } ` | |
| | Sort-Object { $_.metrics.favorites } -Descending |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class KeyedMutex<K : Any> { | |
| private val locks = ConcurrentHashMap<K, Mutex>() | |
| suspend fun <T> withLock(key: K, block: suspend () -> T): T { | |
| val mutex = locks.getOrPut(key) { Mutex() } | |
| return mutex.withLock { block() } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $title = "Confirmation" | |
| $message = "Do you want to proceed?" | |
| $options = [System.Management.Automation.Host.ChoiceDescription[]] @("&Yes", "&No") | |
| $default = 0 # This sets 'Yes' as the default | |
| $result = $host.ui.PromptForChoice($title, $message, $options, $default) | |
| if ($result -eq 0) { Write-Host "You chose Yes!" } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "keyMappings": "# Insert your preferred key mappings here.\n\nunmapAll\n\n\nmap ?? showHelp\n\nmap e scrollUp\nmap d scrollDown\n\nmap U scrollPageUp\nmap J scrollPageDown\nmap 9 scrollToTop\nmap 0 scrollToBottom\n\nmap CC copyCurrentUrl\n\nmap ii focusInput\n\nmap ñ LinkHints.activateMode\nmap Ñ LinkHints.activateModeToOpenInNewForegroundTab\n\nmap o Vomnibar.activate\nmap O Vomnibar.activateInNewTab\n\nmap b Vomnibar.activateBookmarks\nmap B Vomnibar.activateBookmarksInNewTab\n\nmap T Vomnibar.activateTabSelection\n\n#map / enterFindMode\nmap n performFind\nmap N performBackwardsFind\n\nmap > moveTabLeft\nmap < moveTabRight\n\nmap h goForward\nmap H goBack\n\nmap g9 firstTab\nmap g0 lastTab", | |
| "linkHintCharacters": "asdfghjkl", | |
| "settingsVersion": "2.3.1", | |
| "userDefinedLinkHintCss": ":root div > .vimiumHintMarker {\n/* linkhint boxes */\nbackground: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#85FFAA),\n color-stop(100%,#40F594));\nborder: 1px solid #23E373;\n}\n\n:root div > .vimi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # --- Configuración de Grupos de Caracteres --- | |
| $VOWEL_SET = "AEIOUaeiouÀÁÄÈÉËÌÍÏÒÓÖÙÚÜàáäèéëìíïòóöùúü" | |
| $OPEN_PLAIN = "aeo" | |
| $OPEN_ACCENTED = "áàéèóò" | |
| $OPEN_FULL = $OPEN_PLAIN + $OPEN_ACCENTED | |
| $CLOSED_PLAIN = "iu" | |
| $CLOSED_ACCENTED = "íìúù" | |
| $BEFORE_L_GROUP = "bvckfgpt" | |
| $BEFORE_R_GROUP = "bvcdkfgpt" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package packageName | |
| import android.app.AlertDialog | |
| import android.content.Context | |
| import android.view.Gravity | |
| import android.widget.LinearLayout | |
| import android.widget.NumberPicker | |
| import java.time.LocalTime | |
| import kotlin.math.roundToInt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # PowerShell script to optimize the CPU usage to avoid doing it manually in the Windows Panel Control. | |
| if (-not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltinRole] "Administrator")) { | |
| Write-Host "No eres administrador, reiniciando script con permisos elevados..." -ForegroundColor Yellow | |
| $newProcess = Start-Process powershell "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs -PassThru | |
| $newProcess.WaitForExit() | |
| exit | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| NOTES: | |
| ----- Something that we could do to make this more powerful would be to first transpile to a low level PowerShell code and then transpile to GlovePIE. | |
| - Numeric types in GlovePIE are int32 and float, so we should use them instead of | |
| other alternatives. | |
| - When we wait inside an if, let's say it's the first line, it will not execute until | |
| the rest of the code is executed or there is a wait. | |
| - If an if has not finished due to a pending wait then the if will be ignored in that execution | |
| - There's an 'int' function that seems to truncate float numbers (this does not convert strings to int). | |
| - There's a 'float' that converts an int to float and convert strings to floats. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function ConvertTo-DataObject { | |
| param ( | |
| [Parameter(Mandatory, ValueFromPipeline)] | |
| [Object] $InputObject | |
| ) | |
| if ($InputObject -is [Hashtable]) { | |
| $InputObject = [PSCustomObject]$InputObject | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.math.BigInteger | |
| data class BinaryTreeNode<T>( | |
| val value: T, | |
| val left: BinaryTreeNode<T>? = null, | |
| val right: BinaryTreeNode<T>? = null | |
| ) { | |
| override fun toString(): String { | |
| if (left == null && right == null) { | |
| return "BinaryTreeNode($value)" |
NewerOlder