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 / 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;
}
@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
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 / 1-tailwindbreaks.html
Last active September 13, 2024 06:21
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 / 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
@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;
@sitefinitysteve
sitefinitysteve / web.config
Last active July 23, 2020 15:23
Sitefinity Assembly Binding example
<!-- https://www.sitefinitysteve.com/blog/code/2012/03/25/avoid-version-errors-with-assembly-binding -->
<?xml version="1.0" encoding="UTF-8"?>
<runtime>
<!-- So this binds everything to 12.2.7100.1 as an example -->
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Telerik.Sitefinity" publicKeyToken="b28c218413bdf563" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="12.2.7100.1" />
</dependentAssembly>
<dependentAssembly>
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";