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-Module SQLPS -DisableNameChecking | |
| Import-Module PSCX | |
| $dt = Get-Date -Format yyyyMMddHHmmss | |
| $dbname = 'DBNAME' | |
| Backup-SqlDatabase -ServerInstance .\SQLEXPRESS -Database $dbname -BackupFile "C:\Backups\$($dbname)_db_$($dt).bak" | |
| write-zip "C:\WebSites\SITENAME\*" "C:\Backups\$($dbname)_website_$($dt).zip" |
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
| Stop-Service w32time | |
| w32tm /config /manualpeerlist:"0.ro.pool.ntp.org 1.ro.pool.ntp.org pool.ntp.org" /syncfromflags:MANUAL | |
| Start-Service w32time |
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
| var AutocompleteTextarea = function () { | |
| this.lastFocus = {}; | |
| }; | |
| AutocompleteTextarea.prototype = (function () { | |
| function setSave(textareaId, storageKey) { | |
| $("form").on("submit", function (ev) { |
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
| public static string SanitizeFolderName(string name) | |
| { | |
| string regexSearch = new string(Path.GetInvalidFileNameChars()) + new string(Path.GetInvalidPathChars()); | |
| var r = new Regex(string.Format("[{0}]", Regex.Escape(regexSearch))); | |
| return r.Replace(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
| private string EnsureFileNameDoesNotExist(string storagePath, string fileName) | |
| { | |
| while (System.IO.File.Exists(Path.Combine(storagePath, fileName))) | |
| { | |
| var extension = Path.GetExtension(fileName); | |
| var fileNameWithoutExtension = Path.GetFileNameWithoutExtension(fileName); | |
| var fileCountMarker = new Regex("\\((?<count>[0-9]+)\\)$"); | |
| var matchResult = fileCountMarker.Match(fileNameWithoutExtension); |
NewerOlder