Skip to content

Instantly share code, notes, and snippets.

View jbubriski's full-sized avatar

John Bubriski jbubriski

View GitHub Profile
@jbubriski
jbubriski / rebuild-all-indexes.sql
Created February 22, 2018 17:28
This will rebuild all the indexes in your DB.
DECLARE @TableName varchar(255);
DECLARE TableCursor CURSOR FOR
SELECT table_name
FROM information_schema.tables
WHERE table_type = 'base table'
OPEN TableCursor
FETCH NEXT FROM TableCursor INTO @TableName
@jbubriski
jbubriski / rebuild-all-indexes.sql
Created February 22, 2018 17:28
This will rebuild all the indexes in your DB.
DECLARE @TableName varchar(255);
DECLARE TableCursor CURSOR FOR
SELECT table_name
FROM information_schema.tables
WHERE table_type = 'base table'
OPEN TableCursor
FETCH NEXT FROM TableCursor INTO @TableName
@jbubriski
jbubriski / rebuild-all-indexes.sql
Created February 22, 2018 17:28
This will rebuild all the indexes in your DB.
DECLARE @TableName varchar(255);
DECLARE TableCursor CURSOR FOR
SELECT table_name
FROM information_schema.tables
WHERE table_type = 'base table'
OPEN TableCursor
FETCH NEXT FROM TableCursor INTO @TableName
@jbubriski
jbubriski / GameManager.cs
Created November 23, 2017 00:03 — forked from codeimpossible/GameManager.cs
Cross Platform GamePad Input for Unity
using System;
using UnityEngine;
public class GameManager : MonoBehaviour {
public IInputSystem Input;
public static GameManager Instance;
void Awake() {
@jbubriski
jbubriski / C# T4 POCO Generator.tt
Created January 13, 2012 16:38
T4 POCO Generator
<#@ Include File="SaveOutput.tt" #>
<#@ Assembly Name="System.Xml" #>
<#@ Assembly Name="System.Text.RegularExpression" #>
<#@ Assembly Name="Microsoft.SqlServer.ConnectionInfo" #>
<#@ Assembly Name="Microsoft.SqlServer.Management.Sdk.Sfc" #>
<#@ Assembly Name="Microsoft.SqlServer.Smo" #>
<#@ Import Namespace="Microsoft.SqlServer.Management.Smo" #>
<#@ Import Namespace="System.Xml.Serialization" #>
<#@ Import Namespace="System.Collections" #>
<#@ Import Namespace="System.Collections.Generic" #>
@jbubriski
jbubriski / parse.cs
Last active May 25, 2017 18:35
C# SubDomain Parsing
void Main()
{
var testCases = new[] {
null,
"",
"localhost",
"johnnycode.com",
"blog.johnnycode.com",
"a.b.c.blog.johnnycode.com"
};
@jbubriski
jbubriski / Program.cs
Created March 24, 2017 20:06
Dijkstra's Algorithm Setup.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CallStackExample
{
class Program
{
@jbubriski
jbubriski / test.rb
Created March 7, 2017 20:43
Test Jekyll Plugin. Place in default _plugins directory. Then run `jekyll build` and you should see some output from the plugin.
module Jekyll
class TestGenerator < Generator
def generate(site)
print "Testing generator\n"
end
end
end
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SoAlgorithms
{
class BinarySearch
{
@jbubriski
jbubriski / BehaviourButtonsEditor
Created November 17, 2016 15:45
Add editor buttons to your MonoBehaviours methods
using UnityEditor;
using UnityEngine;
namespace BitStrap
{
/// <summary>
/// Custom editor for all MonoBehaviour scripts in order to draw buttons for all button attributes (<see cref="ButtonAttribute"/>).
/// </summary>
[CustomEditor( typeof( MonoBehaviour ), true, isFallback = true )]
[CanEditMultipleObjects]