Skip to content

Instantly share code, notes, and snippets.

@rbaty-barr
rbaty-barr / podbeanAPI.js
Last active December 15, 2018 15:32
get total number of plays
<script>
function addCommas(nStr)
{
nStr += '';
x = nStr.split('.');
x1 = x[0];
x2 = x.length > 1 ? '.' + x[1] : '';
var rgx = /(\d+)(\d{3})/;
while (rgx.test(x1)) {
x1 = x1.replace(rgx, '$1' + ',' + '$2');
@rbaty-barr
rbaty-barr / helpers.cs
Created February 7, 2018 14:46
CSAC app_code helpers
using System;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.Mvc;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
@rbaty-barr
rbaty-barr / formsDocsMedia2.cshtml
Created December 1, 2017 19:43
forms and docs with mediapicker2
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
var mediaRoot = Model.Content.GetPropertyValue<IPublishedContent>("formsAndDocs");
}
<div id="formsDocsArea">
@if(mediaRoot != null && Model.Content.GetPropertyValue<string>("asHideShow") == "True"){
foreach( var item in mediaRoot.Children()){
@rbaty-barr
rbaty-barr / gridContent.json
Last active October 17, 2017 14:20
indexing the grid
contentGrid:{
"name":"Main Layout",
"sections":[
{
"grid":12,
"rows":[
{
"name":"Single Cell Row",
"areas":[
{
@rbaty-barr
rbaty-barr / custom.js
Last active September 29, 2017 13:28
A class of helpers i am using for an intranet project
function getDateInfo(info) {
var test = info.toString();
$.ajax({
type: 'POST',
url: "/umbraco/surface/rendercalendar/listevents",
//contentType: "application/json; charset=utf-8",
data: {'matchThis': test},
datatype: "json",
success: function (data) {
console.log(data);
@rbaty-barr
rbaty-barr / grid.config
Created September 6, 2017 14:50
This is a sample of a custom pre-vaule editor that is a checkbox property for the grid
[
{
"label": "Show by state",
"description": "Show this row for the following states.",
"key": "state",
"view": "/App_Plugins/StatePicker/state-picker-list.html",
"applyTo": "row",
"defaultConfig": {
"selectMultiple": true,
"displaySelectInversed": true,
@rbaty-barr
rbaty-barr / bstrap4MainNav.cshtml
Last active August 24, 2017 18:25
bootstrap v4 basic navigation script for umbraco
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
var homeActive = "active";
var homeUrl = @Model.Content.AncestorOrSelf(1);
}
<nav class="navbar navbar-expand-lg navbar-light bg-light" id="mainNav">
<button type="button" class="navbar-toggler w-100 border-0 text-left" data-toggle="collapse" data-target="#ba-nav" aria-controls="ba-nav" aria-expanded="false" aria-label="Toggle navigation">
@rbaty-barr
rbaty-barr / search.cshtml
Last active July 24, 2017 12:57
This is a first pass at some search scripting for us to use - note, there are some config file updates, but this is just for quick storage
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@using System.Text
@using System.Text.RegularExpressions
@using Examine;
@using Examine.LuceneEngine.SearchCriteria;
@{
Layout = "InsideMain.cshtml";
}
@rbaty-barr
rbaty-barr / emailgrid.cshtml
Created June 30, 2017 16:57
here is my complete custom grid based on salted
@inherits UmbracoViewPage<dynamic>
@using Umbraco.Web.Templates
@using Newtonsoft.Json.Linq
@*
Razor helpers located at the bottom of this file
*@
@if (Model != null && Model.sections != null)
{
@rbaty-barr
rbaty-barr / calltoactionbutton.cshtml
Created June 30, 2017 16:54
Call to Action Button for salted template in umbraco grid
@inherits UmbracoViewPage<Lecoati.LeBlender.Extension.Models.LeBlenderModel>
@if (Model.Items.Any())
{
var isFrontEnd = Lecoati.LeBlender.Extension.Helper.IsFrontEnd();
foreach (var item in Model.Items)