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
| /* | |
| Generate your bookmarklet here: https://d.vensko.net/google-script-save-snippets-to-google-drive | |
| Copyright (c) 2017 Dzmitry Vensko | |
| Permission is hereby granted, free of charge, to any person obtaining | |
| a copy of this software and associated documentation files (the | |
| "Software"), to deal in the Software without restriction, including | |
| without limitation the rights to use, copy, modify, merge, publish, | |
| distribute, sublicense, and/or sell copies of the Software, and to |
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 | |
| $wmi = new COM("winmgmts:{impersonationLevel=impersonate}!//./root/cimv2"); | |
| $events = $wmi->ExecNotificationQuery("Select * From __InstanceOperationEvent Within 2 Where (Targetinstance Isa 'CIM_DataFile' Or Targetinstance Isa 'CIM_Directory') And TargetInstance.Drive='e:' And TargetInstance.Path='\\\\WATCH_DIRECTORY\\\\'"); | |
| while ($latestEvent = $events->NextEvent()) { | |
| print_r($latestEvent->Path_->Class); | |
| print_r([ | |
| $latestEvent->TargetInstance->Name, |
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
| /* | |
| Based on https://addons.mozilla.org/en-US/firefox/addon/facebook-share-button/ | |
| Bookmarklet: | |
| javascript:var%20doc=window.document,fbdiv=doc.getElementById("fblk_div");if(fbdiv)fbdiv.style.display="block"!=fbdiv.style.display?"block":"none";else{fbdiv=doc.createElement("div"),fbdiv.setAttribute("id","fblk_div"),fbdiv.setAttribute("style","display:block;%20top:0;%20right:0;%20z-index:2147483647;%20margin:0;%20padding:10px;%20position:fixed;%20background-color:white;%20border:1px%20solid%20black;");var%20iframe=doc.createElement("iframe");iframe.setAttribute("type","content"),iframe.setAttribute("style","overflow:hidden;%20height:25px;%20width:230px;%20border:none;"),iframe.setAttribute("src","https://www.facebook.com/plugins/like.php?href="+encodeURIComponent(window.location.href)+"&layout=button_count&show_faces=false&share=true&action=like&colorscheme=light&height=25&width=230"),fbdiv.appendChild(iframe),doc.body.appendChild(fbdiv)}void(0) | |
| */ | |
| var doc = window.document; | |
| var fbdiv = doc.getElementById("fblk |
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
| * { | |
| font-size: 12pt; | |
| font-family: monospace; | |
| font-weight: normal; | |
| font-style: normal; | |
| text-decoration: none; | |
| color: black; | |
| cursor: default; | |
| } |
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 http://blog.vensko.net/webdev/web-server-batch-script | |
| @echo off | |
| tasklist /FI "IMAGENAME eq php.exe" 2>NUL | find /I /N "php.exe" >nul | |
| if "%ERRORLEVEL%"=="0" ( | |
| echo Stopping PHP server... | |
| taskkill /F /FI "IMAGENAME eq php.exe" 2>&1 >nul | |
| ) | |
| tasklist /FI "IMAGENAME eq memcached.exe" 2>NUL | find /I /N "memcached.exe" >nul |
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 http://blog.vensko.net/webdev/web-server-batch-script | |
| @echo off | |
| @setlocal | |
| @setlocal enabledelayedexpansion | |
| @cls | |
| SET PARAMS=%* | |
| if "!PARAMS!"=="" SET PARAMS=php | |
| if exist "%cd%\www" SET DOCUMENT_ROOT=%cd%\www |
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 | |
| $uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); | |
| $uri = urldecode($uri); | |
| if ($uri === '/' || isset($_SERVER['SCRIPT_FILENAME']) || file_exists($_SERVER['DOCUMENT_ROOT'].$uri)) { | |
| return false; | |
| } else { | |
| if (file_exists(__DIR__.$uri)) { | |
| if (is_dir(__DIR__.$uri)) { |