Skip to content

Instantly share code, notes, and snippets.

View jsheely's full-sized avatar

Jonathan Sheely jsheely

View GitHub Profile
@jsheely
jsheely / gist:4371856
Created December 25, 2012 06:14
DotNetNuke ModulePackage.targets file that will package up your DNN module when built in release mode.
<?xml version="1.0" encoding="windows-1252"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- Variable used to fine DNN Manifest File -->
<DNNFileName>$(AssemblyName)</DNNFileName>
<!--Variable used to create the install and source zip file-->
<PackageName>$(AssemblyName)</PackageName>
<!-- Variable used to find the location of the DotNetNuke installation bin folder. Used to get the projects binary DLL.
Assumes your your project will be stored in a company/module folder.
Ex: DesktopModules/CompanyName/ModuleName/-->
@jsheely
jsheely / gist:4393435
Created December 28, 2012 00:18
Data Expose example of pulling all users from DotNetNuke installation
<script type="text/javascript">
(function($){
$(document).ready(function(){
$.ajax({
url:'/dataexpose_v1/DesktopModules/InspectorIT/DataExpose/API/Services/Execute',
dataType:'json',
data: {feed:'GetAllUsers',feedParams:'0,0,50,0,0'}
}).success(function(data){
//Do something with JSON Data
});
@jsheely
jsheely / file1.cs
Created January 10, 2013 03:51
Recover Your DotNetNuke Host Password
<%@ Page Language="C#" %>
<script runat="server">
void Page_Load(object sender, System.EventArgs e)
{
DotNetNuke.Entities.Users.UserInfo uInfo =
DotNetNuke.Entities.Users.UserController.GetUserById(0, 1);
if (uInfo != null)
{
string password =
@jsheely
jsheely / file1.sql
Created January 10, 2013 03:58
Clear EventLog On All DotNetNuke Databases
--Application: Clear EventLog in all DotNetNuke Databases
--Created By: Jonathan Sheely
DECLARE @DEBUG BIT
SET @DEBUG=1 --Switch from EXEC to PRINT
DECLARE @dbname NVARCHAR(100)
DECLARE @EventLogTableName NVARCHAR(100)
DECLARE @ParmDefinition NVARCHAR(100)
DECLARE @sqlstr NVARCHAR(MAX)
DECLARE @sqlout NVARCHAR(100)
@jsheely
jsheely / gist:4526139
Last active November 28, 2019 01:33
Backup your MS SQL Databases. Perfect for SQL Express.
DECLARE @BackupFile varchar(255), @DB varchar(30), @Description varchar(255), @LogFile varchar(50)
DECLARE @Name varchar(30), @MediaName varchar(30), @BackupDirectory nvarchar(200)
SET @BackupDirectory = 'F:\Backups\Databases\'
--Add a list of all databases you don't want to backup to this.
DECLARE Database_CURSOR CURSOR FOR SELECT name FROM sysdatabases WHERE name <> 'tempdb' AND name <> 'model' AND name <> 'Northwind' AND name <> 'msdb' AND name <> 'master'
OPEN Database_Cursor
FETCH next FROM Database_CURSOR INTO @DB
WHILE @@fetch_status = 0
BEGIN
@jsheely
jsheely / gist:5558625
Created May 11, 2013 01:58
Enable tabs that can be linked to directly by url ex. www.example.com/page.aspx#tab2
jQuery(document).ready(function(){
var tabCollection="#tab-instanceId";
var selectedTabHash = "#tab_" + window.location.hash.replace(/#/,"");
$(tabCollection).tabs()
.bind("tabsshow",function(event,ui){window.location.hash=ui.tab.hash.replace(/#/,"").replace(/tab_/,"");})
.tabs("select", selectedTabHash);
$(window).bind('hashchange', function() {
$(tabCollection).tabs( "select" , "#tab_" + window.location.hash.replace(/#/,""));
});
@jsheely
jsheely / gist:5596901
Created May 17, 2013 04:19
Web.config settings for CORS support. Add to System.webServer node
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Headers" value="Origin, X-Requested-With, Content-Type, Accept" />
<add name="Access-Control-Allow-Methods" value="GET, POST, PUT, DELETE, OPTIONS" />
</customHeaders>
</httpProtocol>
@jsheely
jsheely / LayoutController.vb
Created June 12, 2013 04:22
Ventrian News Articles. Enable date formatter on custom properties.
If (layoutArray(iPtr + 1).ToUpper().StartsWith("CUSTOM:")) Then
Dim field As String = layoutArray(iPtr + 1).Substring(7, layoutArray(iPtr + 1).Length - 7)
Dim customFieldID As Integer = Null.NullInteger
Dim objCustomFieldSelected As New CustomFieldInfo
Dim isLink As Boolean = False
Dim objCustomFieldController As New CustomFieldController
Dim objCustomFields As ArrayList = objCustomFieldController.List(objArticle.ModuleID)
@jsheely
jsheely / IIS-ReWrite-Remove-ASPX.xml
Last active August 31, 2017 12:43
IIS Url ReWrite rule to remove .aspx extension
<rule name="san aspx">
<!--Removes the .aspx extension for all pages.-->
<match url="(.*)" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="{R:1}.aspx" />
</rule>
@jsheely
jsheely / gist:0e547b0e80ef11062790
Created June 18, 2014 17:56
DNN Available URL Provider Settings
AUM_AllowDebugCode
AUM_AutoAsciiConvert
AUM_DoNotRedirectHttpsUrlRegex
AUM_DoNotRedirectUrlRegex
AUM_DoNotRewriteRegEx
AUM_DoNotUseFriendlyUrlRegex
AUM_EnableCustomProviders
AUM_ForceLowerCase
AUM_IgnoreUrlRegex
AUM_KeepInQueryStringRegex