This file contains 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
pub fn reverse_string(s: &mut Vec<char>) { | |
if s.len() <= 1 { | |
return; | |
} | |
let mut i = 0; | |
let mut j = s.len() - 1; | |
while i != j && i < j { | |
s.swap(i, j); | |
i += 1; | |
j -= 1; |
This file contains 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
@echo off | |
REM download the microsoft devcon app https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/devcon | |
REM Download x64 if your arch is x64 same for x32 | |
REM change this 'USBSTOR\DISK&VEN_WD&PROD_ELEMENTS_25A2&REV_1021\57584131413438324C384543&0' to your device instace path | |
REM Run as Administrator | |
:exec | |
devcon enable @"USBSTOR\DISK&VEN_WD&PROD_ELEMENTS_25A2&REV_1021\57584131413438324C384543&0" | |
goto:exec |
This file contains 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
//Example: log 'Hello World' after language-colors.css load completed | |
/** | |
loadScript("https://quickutils.github.io/language-colors/language-colors.css", function() { | |
console.log('Hello World'); | |
}); | |
**/ | |
function loadScript(url, callback) { | |
var head = document.body; | |
var script = document.createElement('script'); |
This file contains 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
Param([string]$Title,[string]$Message,[string]$MessageType) | |
Add-Type -AssemblyName System.Windows.Forms | |
$global:balloon = New-Object System.Windows.Forms.NotifyIcon | |
Get-Member -InputObject $Global:balloon 2>&1 | Out-Null | |
[void](Register-ObjectEvent -InputObject $balloon -EventName MouseDoubleClick -SourceIdentifier IconClicked -Action { | |
$global:balloon.dispose() | |
}) | |
$path = (Get-Process -id $pid).Path | |
$balloon.Icon = [System.Drawing.Icon]::ExtractAssociatedIcon($path) | |
[System.Windows.Forms.ToolTipIcon] | Get-Member -Static -Type Property 2>&1 | Out-Null |
This file contains 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
@echo off | |
setlocal enabledelayedexpansion | |
REM Listen for kubenetes pod status changes, | |
REM change the value of NAME to your pod name or unique | |
REM part of the name, if more than one pod has the unique | |
REM part there will be conflict in the log | |
REM or you can set the pod name from commandline | |
REM | |
REM $ monitorpod podname apodnamespace anotherpodname apodpartname |
This file contains 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
Param( | |
# the commands to execute or the file to execute | |
[Parameter(Mandatory=$false, ValueFromRemainingArguments = $true)] | |
[string[]]$Commands | |
) | |
Function Main { | |
If ($Commands) { | |
Evalute-Line $Commands |
This file contains 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
#!/bin/bash | |
FIRST_COMMAND= | |
OTHER_COMMANDS= | |
BANG_LINE= | |
main() | |
{ | |
for arg in "$@" | |
do |
This file contains 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
#!/bin/sh | |
SONAR_QUBE_HOST="$1" | |
if [[ "$SONAR_QUBE_HOST" == "" ]]; | |
then | |
SONAR_QUBE_HOST=http://34.89.91.40:9000 | |
fi | |
# download and install sonar-scanner | |
apt-get update |