Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
<div class="flex space-x-2 mb-4 rounded border text-center text-sm font-bold"> | |
<div class="flex-1 p-2"><span class="text-green-700 mr-1 xs:inline-block sm:hidden">✓</span><span class="text-red-700 mr-1 hidden sm:inline-block">✗</span><br>XS</div> | |
<div class="flex-1 p-2"><span class="text-green-700 mr-1 hidden sm:inline-block md:hidden">✓</span><span class="text-red-700 mr-1 inline-block sm:hidden md:inline-block">✗</span><br>SM</div> | |
<div class="flex-1 p-2"><span class="text-green-700 mr-1 hidden md:inline-block lg:hidden">✓</span><span class="text-red-700 mr-1 inline-block md:hidden lg:inline-block">✗</span><br>MD</div> | |
<div class="flex-1 p-2"><span class="text-green-700 mr-1 hidden lg:inline-block xl:hidden">✓</span><span class="text-red-700 mr-1 inline-block lg:hidden xl:inline-block">✗</span><br>LG</div> | |
<div class="flex-1 p-2"><span class="text-green-700 mr-1 hidden xl:inline-block 2xl:hidden">✓</span><span class="text-red-700 mr-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
document.getElementById('canvas').toBlob(function(blob){ | |
var image = document.createElement('img'); | |
var url = URL.createObjectURL(blob); | |
image.onload = function() { | |
URL.revokeObjectURL(url); | |
} | |
console.log(url); | |
image.src = url; | |
document.body.appendChild(image); | |
}); |
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
-- Takes a timestamp (in seconds) and a timezone offset (eg +0730) and returns a timestamp | |
CREATE TEMPORARY FUNCTION applyTZOffsetToUnixTimestamp(ts INT64, tzOffset STRING) | |
RETURNS INT64 AS ( | |
CASE | |
WHEN SUBSTR(tzOffset, 1, 1) = '+' THEN ts + (CAST(SUBSTR(tzOffset, 2, 2) AS INT64) * 60 * 60) + (CAST(SUBSTR(tzOffset, 4, 2) AS INT64) * 60) | |
WHEN SUBSTR(tzOffset, 1, 1) = '-' THEN ts - (CAST(SUBSTR(tzOffset, 2, 2) AS INT64) * 60 * 60) - (CAST(SUBSTR(tzOffset, 4, 2) AS INT64) * 60) | |
ELSE NULL | |
END | |
); |
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
@{ | |
LinkField URL = item.Fields["URL"]; | |
if (URL != null) | |
{ | |
<a href="@URL.Url" target="@URL.Target" title="@URL.Title">@URL.Title ></a> | |
} | |
} |
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
$('#article-content').find('h1,h2,h3,h4,h5,h6').each(function(i,el) {console.log(i + "\t" + el.tagName + "\t" + $(el).text())}) |
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
/* | |
* if C2 contains a DateTimeOffset eg 2015-08-13 09:31:12.0000000 +01:00 | |
* parse the date and time out and add them together | |
* then subtract the hours offset (which - in Excel time storage is hours/24) | |
* note that this ignores the minute-part of an offset (eg Venezuela) | |
*/ | |
=DATE(LEFT($C2,4), MID($C2,6,2),MID($C2,9,2)) + TIME(MID($C2,12,2),MID($C2,15,2),MID($C2,18,2)) + (MID($C2,29,3)/24) |
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
// define how many items we want per chunk | |
var itemsPerChunk = 3; | |
// break the list of items into chunks | |
var chunks = items.Select((s, i) => new { Value = s, Index = i }).GroupBy(item => item.Index / itemsPerChunk, item => item.Value); | |
// iterate through each chunk | |
foreach (var chunk in chunks) | |
{ | |
<div class="row"> |
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
ImageField field = context.Fields["Img"]; | |
if (field != null && field.MediaItem != null) | |
{ | |
var ImgItem = new Sitecore.Data.Items.MediaItem(field.MediaItem); | |
var ImgUrl = Sitecore.Resources.Media.MediaManager.GetMediaUrl(ImgItem); | |
var ImgCaption = field.Alt; | |
} |
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 p = Html.Sitecore().CurrentRendering.Parameters; | |
bool fullWidth = (p["Full width"] == "1") ? true : false; | |
string widthClass = (fullWidth) ? "fullwidth" : "indented"; |
NewerOlder