Skip to content

Instantly share code, notes, and snippets.

@birksy89
birksy89 / Return JSON - DNN Web API
Created March 8, 2017 11:38
Return JSON - DNN Web API
[AllowAnonymous]
[HttpGet]
public HttpResponseMessage GetAllMessages()
{
try
{
//Load Data Into List
var mm = new MessageManager();
List<Message> msgs = mm.GetAllMessages();
public void getTeams()
{
var json = GET("http://api.football-data.org/v1/competitions/426/teams");
dynamic jsonObj = JsonConvert.DeserializeObject(json);
var tm = new TeamManager();
foreach (var obj in jsonObj.teams)
{
@birksy89
birksy89 / gist:95daa17fa4ce67313d7b43ca4ceb1b04
Created March 1, 2017 10:29
Post JSON Data From Serverside
using Newtonsoft.Json;
using System.Net;
using System.IO;
public void postJSON()
{
postData pd = new postData();
pd.Name = "Steve";
var imageFolder = Folder.selectDialog("Select a folder to process");
var fWidth = prompt("Width", "", "Width2");
var fHeight = prompt("Height", "", "Height2");
if (imageFolder != null) processFolder(imageFolder);
function processFolder(folder) {
node --inspect --debug-brk foo.js
//All Files
browser-sync start --proxy localhost --files "**.*"
//Specific Files
browser-sync start --proxy localhost --files "*.ascx,*.css,*.js,*.cshtml"
//Specific Files inc. Subfolders
browser-sync start --proxy localhost --files "**/*.ascx,**/*.css,**/*.js,**/*.cshtml"
DECLARE @T TABLE
([DbName] SYSNAME,
[SettingName] VARCHAR(255),
[SettingValue] VARCHAR(255));
INSERT INTO
@T
EXEC sp_MSForEachDB
'SELECT
''?'',
var inputFolder = Folder.selectDialog("Select a folder to process");
var fileList = inputFolder.getFiles("*.*"); //Use whatever extension you want or no extension to select all files
// these are our values for the end result width and height (in pixels) of our image
//var fWidth = 1200;
//var fHeight = 1200;
@birksy89
birksy89 / Dotnetnuke - Add Meta Tags to Head via Razor Files
Last active September 15, 2017 23:15
Dotnetnuke - Add Meta Tags to Head via Razor Files
//we add meta description
System.Web.UI.HtmlControls.HtmlMeta objMetaDescription = new System.Web.UI.HtmlControls.HtmlMeta();
objMetaDescription.Name = "DESCRIPTION";
objMetaDescription.Content = "This will be the meta description content";
DotNetNuke.Framework.CDefault tp = (DotNetNuke.Framework.CDefault)Context.CurrentHandler;
tp.FindControl("Head").Controls.Add(objMetaDescription);
Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(this.TabId, "", "cid=details","PropertyID=4"));