Skip to content

Instantly share code, notes, and snippets.

View normansolutions's full-sized avatar

Clive Norman normansolutions

View GitHub Profile
SELECT TOP 500 UPPER(REPLACE(REPLACE(user_identity, '@STMARYS.EU', ''), 'ST-MARYS\\', '')) as Online, guid, date FROM hits h INNER JOIN tokens t ON (h.user_guid COLLATE DATABASE_DEFAULT = t.guid COLLATE DATABASE_DEFAULT) WHERE AND t.user_identity NOT like('%_1')AND t.user_identity NOT like('%_2') ORDER BY [date] DESC
if (myReader.Read())
{
while (myReader.Read())
{
DateTime loggedDate = Convert.ToDateTime(myReader["date"].ToString());
if (loggedDate.AddMinutes(5) >= DateTime.Now)
{
if (!checkForDup.Contains(myReader["Online"].ToString()))
{
if (count < 10)
<%@ outputcache duration="10" location="Server" varybyparam="None" %>
<br/>
<h3>Most recent visitors</h3>
<script>
(function doPoll() {
var count = 0;
$.ajax({
url: "http://YOUR_DOMAIN_NAME/plugins/clientaspxfiles/stmwhoonline.aspx",
dataType: "json",
success: function (json) {
var strHtml = '<ul>';
Clear-Host
$hsg = Invoke-WebRequest -Uri http://www.stmarys.eu/sitemap.aspx
$links = $hsg.Links | Where class -eq 'rmLink' | select href
$linksWithDomain = $links | Foreach-Object{"http://www.stmarys.eu/" + $_.href}
$linksWithDomain | foreach{
$webClient = new-object System.Net.WebClient
$webClient.Headers.Add("user-agent", "PowerShell Script")
$output = ""
$output = $webClient.DownloadString($_.toString())
if ($output -like "*supportLists*") {
@if (Blog.GetPosts(Blog.PostsPerPage * 2).Count() > Blog.PostsPerPage)
@if (Blog.GetPosts(Blog.PostsPerPage).Count() > Blog.PostsPerPage)
//cdn fallback for Bootstrap css
<div id="bootstrapCssTest" class="hide"></div> // (HTML in _Layout.cshtml)
if ($('#bootstrapCssTest').is(':visible') === true) {
$('<link href="\css/bootstrap.min.css" rel="stylesheet" type="text/css" />').appendTo('head');
}
//cdn fallback for Bootstrap js
if (typeof ($.fn.modal) === 'undefined') {
$('<script src="\scripts/bootstrap.min.js">\x3C/script>').appendTo('head');
}
<ul class="nav navbar-nav">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Recent Articles <b class="caret"></b></a>
<ul class="dropdown-menu">
@foreach (var postTitle in Storage.GetAllPosts().Where(pub => pub.IsPublished == true).Where(pubDate => pubDate.PubDate <= DateTime.Now).Take(10))
{
<li><a href="@postTitle.AbsoluteUrl">@postTitle.Title</a></li>
}
</ul>
</li>
@normansolutions
normansolutions / ListUsersWhoHaveAccess.ps1
Created January 13, 2014 12:11
PowerShell script to display all users to have access to other mailboxes in Exchange. Thanks to: http://exchangeserverpro.com/list-users-access-exchange-mailboxes/
Get-Mailbox | Get-MailboxPermission | where {$_.user.tostring() -ne "NT AUTHORITY\SELF" -and $_.IsInherited -eq $false} | Select Identity,User,@{Name='Access Rights';Expression={[string]::join(', ', $_.AccessRights)}} | Export-Csv -NoTypeInformation mailboxpermissions.csv