Skip to content

Instantly share code, notes, and snippets.

@Spaider
Spaider / Load on scroll
Created February 5, 2014 21:11
Load content on scroll
var loading = false;
$(window).scroll(function(){
if((($(window).scrollTop()+$(window).height())+250)>=$(document).height()){
if(loading == false){
loading = true;
$('#loadingbar').css("display","block");
$.get("load.php?start="+$('#loaded_max').val(), function(loaded){
$('body').append(loaded);
$('#loaded_max').val(parseInt($('#loaded_max').val())+50);
$('#loadingbar').css("display","none");
Begin
Declare @aiRacerID Int
Declare @row Int
Declare @page Int = 1
Declare @pageSize Int = 10000
Set Nocount On
Declare spCursor Cursor fast_forward
For
@Spaider
Spaider / TaskThrottle.cs
Created May 5, 2014 14:37
Task throttling using TAP and .NET v4.5
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace ProducerConsumerTest
{
class Program
{
private const int MAX_CONCURRENCY_LEVEL = 5;
private const int NUM_PAGES = 20;
@Spaider
Spaider / program.cs
Created June 17, 2014 12:24
Simple template-base generator
using System;
using System.IO;
using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;
namespace ConsoleApplication2
{
class Program
{
@Spaider
Spaider / Neo4jHealthCheck.cyp
Created December 9, 2014 12:04
List of health-check queries for neo4j
// Number of Athletes (info)
match (:Athlete)
return count(*)
// Number of Courses (info)
match (:Course)
return count(*)
// Number of Races (info)
match (:Race)
@Spaider
Spaider / ProfileHealthCheck.sql
Last active August 29, 2015 14:11
Athlinks profile health check
DECLARE @login nVARCHAR(50)
SET @login = ''
SET NOCOUNT ON
IF @login = ''
BEGIN
RAISERROR ('Please define @login', 18, 1)
RETURN
@Spaider
Spaider / gist:0106d62ac3af821021fd
Created February 23, 2015 11:14
RSVP with more than one Event
match (r:RSVP)-[rr:RSVP_RACE]->(race:Race)
with r, count(race) as cnt
where cnt > 1
return id(r), cnt
@Spaider
Spaider / gist:5af3a4e3ba17ff507fb9
Created February 23, 2015 11:16
Several athletes with same RSVP
match (a:Athlete)-[ar]->(r:RSVP)
with r, count(a) as cnt
where cnt > 1
return id(r), cnt
@Spaider
Spaider / gist:dd52946ab4ca1c4ca4b3
Created May 7, 2015 13:57
Courses with result count for Trail Running - 2013 vs 2014
select
sumTbl.ID,
cp.CP_Description as 'Description',
sumTbl.[Courses in 2013],
sumTbl.[Courses in 2014],
sumTbl.[Results in 2013],
sumTbl.[Results in 2014]
from
vr_l_CoursePattern cp
inner join
@Spaider
Spaider / Neo4j Health Summary.cyp
Created May 11, 2015 10:09
neo4j health summary
with summary as (
select
r.QueryId,
r.QueryTime,
r.Result,
row_number() over (partition by r.QueryId order by r.QueryTime desc) as rk
from vr_t_Neo4jHealthResult r
)
select
s.QueryId,