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
USE DatabaseName; | |
GO | |
-- Truncate the log by changing the database recovery model to SIMPLE. | |
ALTER DATABASE DatabaseName | |
SET RECOVERY SIMPLE; | |
GO | |
-- Shrink the truncated log file to 1 MB. | |
DBCC SHRINKFILE (DatabaseName_Log, 1); | |
GO | |
-- Reset the database recovery model. |
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
var count = 0; | |
for (const property in app) { | |
try { | |
var l = JSON.stringify(app[property]).length; | |
count += l; | |
console.log(`${property}: ${l}`); | |
} catch(e) { | |
// meh | |
} | |
}; |
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
## Ignore Visual Studio temporary files, build results, and | |
## files generated by popular Visual Studio add-ons. | |
## | |
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore | |
# User-specific files | |
*.suo | |
*.user | |
*.userosscache | |
*.sln.docstates |
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
public TType GetMacroParam<TType>(PartialViewMacroModel model, string key, Func<string, TType> convert, TType fallback) | |
{ | |
if(!model.MacroParameters.ContainsKey(key)) | |
{ | |
return fallback; | |
} | |
var value = model.MacroParameters[key]; | |
if(value == null || value.ToString().Trim() == "") |
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
Git features a ‘remove’ command, git rm. You can use it to remove files from git’s tracking cache, like so: | |
git rm --cached <filename> | |
1 | |
git rm --cached <filename> | |
The above command is for a specific file. It will take effect with your next commit. It’s a good idea for you to commit any pending changes you have before you start this process. If you have many files and/or folders (for instance, your /bin and /obj folders in a .NET project) that you need to clean up from your repository, you can use the following commands to remove them from the index (cache): | |
git rm -r --cached . | |
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
public class ApplicationEvents : ApplicationEventHandler | |
{ | |
protected override void ApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) | |
{ | |
// Tap into the Saving event | |
MediaService.Saving += (sender, args) => | |
{ | |
MediaFileSystem mediaFileSystem = FileSystemProviderManager.Current.GetFileSystemProvider<MediaFileSystem>(); | |
IContentSection contentSection = UmbracoConfig.For.UmbracoSettings().Content; | |
IEnumerable<string> supportedTypes = contentSection.ImageFileTypes.ToList(); |
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
ROBOCOPY folder1 folder1 /S /MOVE |
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
/************************************************************************************************************************************************ | |
Author : KIN SHAH ********************************************************************************************************************* | |
Purpose : Move data from one server to another********************************************************************************************* | |
DATE : 05-28-2013 ********************************************************************************************************************* | |
Version : 1.0.0 ************************************************************************************************************************* | |
RDBMS : MS SQL Server 2008R2 and 2012 ************************************************************************************************* | |
*************************************************************************************************************************************************/ | |
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
DECLARE @NodeId INT | |
DECLARE my_cursor CURSOR local static read_only forward_only FOR | |
SELECT DISTINCT nodeid | |
FROM cmsdocument | |
OPEN my_cursor | |
FETCH next FROM my_cursor INTO @NodeId | |
WHILE @@FETCH_STATUS = 0 |
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
SELECT n.id AS nodeid , | |
n.text , | |
pt.Alias , | |
pd.dataInt , | |
pd.dataDate , | |
pd.dataNvarchar , | |
pd.dataNtext | |
FROM cmsPropertyData AS pd | |
INNER JOIN cmsPropertyType AS pt ON pt.id = pd.propertytypeid | |
INNER JOIN umbracoNode AS n ON n.id = pd.contentNodeId |
NewerOlder