Skip to content

Instantly share code, notes, and snippets.

View sitefinitysteve's full-sized avatar
🏠
Working from home

Steve McNiven-Scott sitefinitysteve

🏠
Working from home
View GitHub Profile
@sitefinitysteve
sitefinitysteve / 1-tailwindbreaks.html
Last active May 15, 2023 08:39
Tailwind responsive breakpoint viewer
<!-- TAILWIND CSS RESPONSIVE SIZE -->
<span class="text-xs text-gray-200 tailwind-breaks">
<span class="inline-block sm:hidden">XS</span>
<span class="hidden sm:inline-block md:hidden">SM</span>
<span class="hidden md:inline-block lg:hidden">MD</span>
<span class="hidden lg:inline-block xl:hidden">LG</span>
<span class="hidden xl:inline-block">XL</span>
</span>
@sitefinitysteve
sitefinitysteve / bootstrap4-responsive-utilities.css
Last active April 11, 2022 18:38
Bootstrap 4 Responsive Utilities for porting into Bootstrap 3
/*!
* Bootstrap v4.6.1 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors
* Copyright 2011-2021 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
.align-baseline {
vertical-align: baseline !important;
}
import { available } from "nativescript-appavailability";
import { isAndroid, isIOS, device, screen } from "tns-core-modules/platform";
import * as utils from "tns-core-modules/utils/utils";
export function onOpenLink(args){
let link: LinkItem = args.view.bindingContext;
if (link.domain == "facebook.com") {
//FACEBOOK APP
const fbScheme = isIOS ? "fb://" : "com.facebook.katana";
@sitefinitysteve
sitefinitysteve / HandlerCSharp.cs
Created September 9, 2021 12:23
VueJs Form Postback
[HttpPost]
public ActionResult UploadFile(HttpPostedFileBase file, string returnUrl)
{
if (file == null)
{
TempData["UploadError"] = "File Error";
return RedirectPermanent(returnUrl);
}
try
@sitefinitysteve
sitefinitysteve / SearchAllTables.sql
Created July 24, 2020 15:26
/blog/code/2012/03/16/the-best-stored-procedure-youll-ever-use-for-sitefinity
CREATE PROC SearchAllTables]
(
@SearchStr nvarchar(100)
)
AS
BEGIN
-- Copyright © 2002 Narayana Vyas Kondreddi. All rights reserved.
-- Purpose: To search all columns of all tables for a given search string
-- Written by: Narayana Vyas Kondreddi
using System;
using System.Linq;
using Telerik.Sitefinity.Abstractions;
using Telerik.Sitefinity.Services;
using Telerik.Sitefinity.SitemapGenerator.Abstractions.Events;
using Telerik.Sitefinity.SitemapGenerator.Data;
namespace SitefinityWebApp
{
public class Global : System.Web.HttpApplication
@sitefinitysteve
sitefinitysteve / RadDocumentPdfDownload.cs
Last active August 24, 2020 16:21
Sitefinity RadDocument PDF Export Sample
protected void OnDownloadPDF_Click(object sender, EventArgs e) {
string output = "";
byte[] buffer = new byte[0];
string filename = "file"
string html = Util.GetHtmlToExport(); //However you want...this is a fake stub
var thread = new Thread(() =>
{
Telerik.Windows.Documents.FormatProviders.Pdf.PdfFormatProvider provider = new Telerik.Windows.Documents.FormatProviders.Pdf.PdfFormatProvider();
@sitefinitysteve
sitefinitysteve / TelerikReportingNeedsDataSource.cs
Created July 24, 2020 15:22
/blog/code/2012/03/16/telerik-reporting-needsdatasource
private void crosstab1_NeedDataSource(object sender, EventArgs e) {
Telerik.Reporting.Processing.Table procReport = (Telerik.Reporting.Processing.Table)sender;
List<Response> submissions = (from s in context.Responses
where s.Submission.FormID == new Guid("6F38E890-6FFE-4F50-A8B5-8C5FDADDAF31")
select s).ToList();
var formatted = (from s in submissions
select new {
Submission = s.Submission,
@sitefinitysteve
sitefinitysteve / TelerikReportingExportToPdf.cs
Created July 24, 2020 15:21
/blog/code/2012/03/16/telerik-reporting--export-on-button-click
void ExportToPDF(Telerik.Reporting.Report reportToExport)
{
ReportProcessor reportProcessor = new ReportProcessor();
RenderingResult result = reportProcessor.RenderReport("PDF", reportToExport, null);
string fileName = result.DocumentName + ".pdf";
Response.Clear();
Response.ContentType = result.MimeType;
Response.Cache.SetCacheability(HttpCacheability.Private);
@sitefinitysteve
sitefinitysteve / getwf4bookmarks.sql
Created July 24, 2020 15:20
/blog/code/2012/03/16/stored-procedure-for-obtaining-wf4-bookmarks
-- =============================================
-- Author: Steve
-- Create date: Auguest 2, 2010
-- Description: Converts the Pending Bookmarks into rows
-- =============================================
CREATE PROCEDURE [dbo].[workflow_Get_Bookmarks]
@instanceID uniqueidentifier = NULL
AS
BEGIN
SET NOCOUNT ON;