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
// given enum | |
export enum DairyTypes { | |
Cheese = 1, | |
Milk = 2, | |
Eggs = 3 | |
} | |
// output 'Eggs' equivalent to c#'s DairyTypes.Eggs.ToString() | |
console.log(DairyTypes[DairyTypes.Eggs]) |
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
[assembly: InternalsVisibleTo("Assembly.Name")] |
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
# from https://stackoverflow.com/a/26180529 | |
%windir%\system32\inetsrv\appcmd.exe set config /section:applicationPools /[name='APP_POOL_NAME'].processModel.identityType:SpecificUser /[name='APP_POOL_NAME'].processModel.userName:DOMAIN\USER_NAME /[name='APP_POOL_NAME'].processModel.password:PASSWORD |
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
mysql --protocol=tcp --host=localhost --user=username -p --port=3306 --default-character-set=utf8mb4 --comments --database=dbname < "/path/import.sql" |
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
UPDATE [aspnet_Membership] SET [Password]='qOvF8m8F2IcWMvfOBjJYHmfLABc=', [PasswordSalt]='OM5gu45RQuJ76itRvkSPFw==', | |
[IsApproved] = '1', [IsLockedOut] = '0' | |
WHERE UserId IN (SELECT UserId FROM dbo.aspnet_Users WHERE UserName = 'sitecore\Admin') |
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
< /dev/urandom tr -db _A-Z-a-z-0-9 | head -c16 |
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
#!/bin/bash | |
sudo add-apt-repository ppa:ondrej/apache2 | |
sudo apt-get update | |
sudo apt-get install apache2 mysql-server mysql-client php libapache2-mod-php7.0 php-mysql mailutils mysql-workbench | |
mysql -u root -p -e "CREATE DATABASE demo; CREATE USER 'demo'@'localhost' IDENTIFIED BY 'passwordgoeshere'; GRANT ALL PRIVILEGES ON demo.* to 'demo' IDENTIFIED BY 'passwordgoeshere'; FLUSH PRIVILEGES;" | |
sudo adduser www-data www-data | |
sudo chown -R www-data:www-data /var/www |
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 search = search || {}; | |
(function(o, win) { | |
let _client = document.getElementById("client"); | |
let _server = document.getElementById("server"); | |
let _dateFmt = function(dateStr) { | |
const options = { year: 'numeric', month: 'short', day: 'numeric' }; | |
return new Date(dateStr).toLocaleDateString("en-US", options); | |
}; |
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
let _idxOf = function(needle){ | |
return function(haystack){ | |
return haystack.toLowerCase().indexOf(needle.toLowerCase()) !== -1; | |
}; | |
}; | |
// e.g | |
let searchTerm = "fly"; | |
let pets = [{ name: 'George', type: 'fly' }, { name: 'Benson', type: 'dog' }]; |
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
Item currentItem = Sitecore.Context.Item; | |
SiteInfo currentSiteRoot = SiteContextFactory.Sites | |
.Where(s => s.RootPath != "" && currentItem.Paths.Path.ToLower().StartsWith(s.RootPath.ToLower())) | |
.OrderByDescending(s => s.RootPath.Length) | |
.FirstOrDefault(); |
NewerOlder