Skip to content

Instantly share code, notes, and snippets.

View finlaybob's full-sized avatar

Neil Finlay finlaybob

  • Edinburgh, Scotland
View GitHub Profile
SELECT
t.name AS TableName,
i.name as indexName,
sum(p.rows) as RowCounts,
sum(a.total_pages) as TotalPages,
sum(a.used_pages) as UsedPages,
sum(a.data_pages) as DataPages,
(sum(a.total_pages) * 8) / 1024 as TotalSpaceMB,
(sum(a.used_pages) * 8) / 1024 as UsedSpaceMB,
(sum(a.data_pages) * 8) / 1024 as DataSpaceMB
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Page.Resources>
<ResourceDictionary>
<!-- Normal Brush -->
<LinearGradientBrush x:Key="NormalBrush" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Offset="0.0" Color="#FFF"/>
<GradientStop Offset="1.0" Color="#CCC"/>
@finlaybob
finlaybob / .bash_profile
Last active November 20, 2017 14:07
My bash profile.
## Weird GIT problems
## Epic amounts of debug command spew
#set -x
## Set text of Prompt.
#export PS1='$(pwd)>'
# Neil's Bash Stuff
# Collection of bash script stuff from various places.
@finlaybob
finlaybob / maketeapotfunc.cpp
Created March 19, 2015 20:18
Function to utilise the teapot mesh.
void Tess3D::MakeTeapot(void)
{
for (int i = 0; i < 10; i++)
{
for (int j = 0; j < 16; j++)
{
meshData.vindex.push_back(TeapotPatches[i].indices[j]);
}
@finlaybob
finlaybob / teapot.h
Created March 19, 2015 20:16
teapot mesh
struct TeapotPatch
{
bool mirrorZ;
int indices[16];
};
// Static data array defines the bezier patches that make up the teapot.
const TeapotPatch TeapotPatches[] =
{
@finlaybob
finlaybob / normalmap.frag
Created March 10, 2013 00:37
Normal Map Fragment Shader
#version 400
layout( location = 0 ) out vec4 frag_main;
struct PointLight{
vec3 position;
vec3 ambient;
vec3 diffuse;
vec3 specular;
float shininess;
float intensity;
};
@finlaybob
finlaybob / normalmap.vert
Created March 10, 2013 00:36
Normal Map Vertex Shader
#version 400
layout (location = 0) in vec3 attribPosition;
layout (location = 1) in vec3 attribNormal;
layout (location = 2) in vec2 attribTexCoord;
layout (location = 3) in vec3 attribTangent;
layout (location = 3) in vec3 attribBinormal;
uniform mat4 mvp;
uniform mat4 mvm;
uniform mat3 nm;
/////////////////////////////////////////////////////////////////////////////////////////
// OpenGL4 Vertex Shader
#version 400
layout (location = 0) in vec3 a_pos;
layout (location = 1) in vec3 a_nor;
layout (location = 2) in vec3 a_uvs;
layout (location = 3) in vec3 a_tan;
layout (location = 4) in vec3 a_bin;
uniform mat4 Projection;
@finlaybob
finlaybob / gist:4090330
Created November 16, 2012 19:52
Timing code
auto t1 = Clock::now();
app->update(0);
app->display();
auto t2 = Clock::now();
auto tt = (t2-t1);
elapsed = (float)tt.count()/1000000.0f;
app->fpsUpdate(elapsed);
@finlaybob
finlaybob / UIWindow.cpp
Created August 29, 2012 14:12
SDL_ttf with OpenGL 3.3
#include "UIWindow.h"
UIWindow::UIWindow(int x, int y, int width, int height,string fontName):
x(x),y(y),height(height),width(width)//,titleFontName(fontName)
{
this->myType = Utils::UI_WINDOW;
//build window