Skip to content

Instantly share code, notes, and snippets.

View jsheely's full-sized avatar

Jonathan Sheely jsheely

View GitHub Profile
@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: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 / 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 / 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 / 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 / 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/-->