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
@ECHO OFF | |
REM This snippet will take an input string with spaces and replace them with %20 | |
SET /p input=Input string: | |
SETLOCAL ENABLEDELAYEDEXPANSION | |
SET input=!input: =%%20! | |
ECHO. | |
ECHO %input% | |
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
@echo off | |
REM Note - this will not work if npp is already running without admin privledges | |
:checkPrivileges | |
NET FILE 1>NUL 2>NUL | |
if '%errorlevel%' == '0' ( goto gotPrivileges ) else ( goto getPrivileges ) | |
:getPrivileges | |
if '%1'=='ELEV' (shift & goto gotPrivileges) |
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
<? | |
//Gets the document name of the page. For example, index.php | |
$getDocument = explode('/', $_SERVER["PHP_SELF"]); | |
$currentPage = $getDocument[count($getDocument) - 1]; | |
//Switch statement | |
switch ($currentPage) { | |
case "index.php": | |
//do something unique on index.php | |
break; |
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
REG.EXE add HKCU\Console /v QuickEdit /t REG_DWORD /d 1 /f |
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
#!/usr/bin/python | |
import httplib | |
import subprocess | |
############################## Site To Check ################################# | |
VAR_hostname = "yoursite.com" | |
VAR_path = "/" | |
######################### DigitalOcean Variables ############################# | |
VAR_dropletID = "123456" | |
VAR_Token = "YOUR_API_TOKEN_HERE" |
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
@ECHO OFF | |
:start | |
SET choice= | |
SET /p choice=Do something? [N]: | |
IF NOT '%choice%'=='' SET choice=%choice:~0,1% | |
IF '%choice%'=='Y' GOTO yes | |
IF '%choice%'=='y' GOTO yes | |
IF '%choice%'=='N' GOTO no | |
IF '%choice%'=='n' GOTO no | |
IF '%choice%'=='' GOTO no |
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
@ECHO off | |
SET STARTTIME=%TIME% | |
REM DO THINGS HERE TO TIME | |
timeout 5 | |
REM DO THINGS HERE TO TIME | |
REM Final Calculations |
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
<# | |
Recursively move all files in C:\SourceDir into C:\Destination | |
Assumes C:\Destination exists already, or there could be problems | |
#> | |
Move-Item -Path "C:\SourceDir\*" -Destination "C:\Destination" |
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
<? | |
//Include Predis library. See https://github.com/nrk/predis for more info | |
require "Predis/Autoloader.php"; | |
//Connect to Redis | |
Predis\Autoloader::register(); | |
try { | |
$redis = new Predis\Client(); | |
$redis = new Predis\Client(array( | |
"scheme" => "tcp", |
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
declare @sql_text char(255); | |
declare @total_time_so_far int; | |
declare @total_percent float; | |
declare @seconds_per_percent float; | |
declare @total_time time; | |
declare @time_left time; | |
SELECT @sql_text = sqltext.TEXT, | |
@total_time_so_far = req.total_elapsed_time, |
OlderNewer