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
| REM use the same filename for both .ps1 and .bat | |
| @echo off | |
| PowerShell.exe -Command "& {Start-Process PowerShell.exe -ArgumentList '-ExecutionPolicy Bypass -File ""%~dpn0.ps1""' -Verb RunAs}" | |
| PAUSE |
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
| #N.B. POWERSHELL 5.1 REQUIRED | |
| $Username = "" | |
| $Password = "" | |
| $group = "Administrators" | |
| $adsi = [ADSI]"WinNT://$env:COMPUTERNAME" | |
| $existing = $adsi.Children | where {$_.SchemaClassName -eq 'user' -and $_.Name -eq $Username } |
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
| <?php | |
| class A { | |
| public $a = 1; | |
| } | |
| $a = new A(); | |
| $b = $a; |
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
| setTimeout(function() { | |
| setInterval(function() { | |
| $('#img1').attr('src',$('#img1').attr('src')) | |
| },1) | |
| }, 2000) |
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
| /** | |
| * Convert seconds to readable time string | |
| * | |
| * @param integer $seconds => seconds es: 3600(1h) | |
| * @return string $finalTime => time string like 1:00:00 or 0:34 | |
| * or an empty string if @param $seconds isn't numeric | |
| */ | |
| public function secondsToTime($seconds){ | |
| if(is_numeric($seconds) && $seconds > 0){ | |
| $hours = floor($seconds / 3600); |