Skip to content

Instantly share code, notes, and snippets.

View seancoyne's full-sized avatar

Sean Coyne seancoyne

View GitHub Profile
SELECT
@@SERVERNAME as InstanceName
, DB_NAME() as DatabaseName
, ISNULL(s.name+'.'+t.NAME, '**TOTAL**') AS TableName
, SUM(p.rows) AS RowCounts
--, SUM(a.total_pages) * 8 AS TotalSpaceKB
, SUM(a.total_pages) * 8/1024.0 AS TotalSpaceMB
, SUM(a.total_pages) * 8/1024.0/1024.0 AS TotalSpaceGB
, SUM(a.used_pages) * 8/1024.0 AS UsedSpaceMB
, (SUM(a.total_pages) - SUM(a.used_pages)) * 8/1024.0 AS UnusedSpaceMB
@seancoyne
seancoyne / farcry-default.sublime-project
Created June 24, 2016 16:00
Sublime Project Defaults for a FarCry site
{
"folders": [
{
"name": "Some Name",
"path": ".",
"folder_exclude_patterns": [
"projects/siteName/www/cache"
]
}
],
@seancoyne
seancoyne / gulpfile.js
Created October 23, 2015 19:15
example gulp setup for testbox-runner
/* jshint node: true */
(function(){
"use strict";
var gulp = require("gulp");
gulp.task("testbox", function(done){
// NOTE: this example assumes you have a .testbox-runnerrc file holding your config settings
@seancoyne
seancoyne / Gruntfile.js
Last active October 23, 2015 19:07
example grunt setup for testbox-runner
/* global module */
(function(module){
"use strict";
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-shell');
grunt.initConfig({
@seancoyne
seancoyne / Application.cfc
Last active October 23, 2015 18:28
example setup for testbox-runner
component {
this.name = "myapp_api_test";
this.mappings = {
"/testbox" = expandPath("/myapp/testbox"),
"/model" = expandPath("/myapp/api/model"),
"/tests" = expandPath("/myapp/api/tests"),
'/api' = expandPath('/myapp/api')
};
@seancoyne
seancoyne / git-add-nonwhitespace-changes.sh
Created April 9, 2015 17:26
stage (git add) only non-whitespace changes
git add `git diff -w |grep '^+++' |cut -c7-`
@seancoyne
seancoyne / find-unlabeled.txt
Created November 11, 2014 19:51
find unlabeled messages in gmail
-has:userlabels -in:sent -in:chat -in:draft -in:inbox
@seancoyne
seancoyne / rowcounts.sql
Created October 30, 2014 14:59
get FarCry row and refobject counts
select d1.tablename, d1.rowcnt, d2.typename, d2.num from (
SELECT
ta.name TableName
,SUM(pa.rows) RowCnt
FROM sys.tables ta
INNER JOIN sys.partitions pa
ON pa.OBJECT_ID = ta.OBJECT_ID
INNER JOIN sys.schemas sc
ON ta.schema_id = sc.schema_id
@seancoyne
seancoyne / build-mod-perl.sh
Created October 24, 2014 18:00
Compile mod_perl for Apache 2.4 on Mac OS X 10.10 Yosemite
#!/usr/bin/env bash
# Compile mod_perl for Apache 2.4 on Mac OS X 10.10 Yosemite
# http://blog.n42designs.com/blog/2014/10/23/compiling-mod-perl-for-apache-2-dot-4-on-os-x-10-dot-10-yosemite/
# NOTE: make sure you have XCode 6.1 & Command Line Tools installed first
# ask for password up front
sudo -v
@seancoyne
seancoyne / fix-onedrive-menu-bar-icons.sh
Created October 21, 2014 15:50
Fix OneDrive Yosemite Dark Mode Menu Bar Icons
#!/usr/bin/env bash
# change to proper directory
cd /Applications/OneDrive.app/Contents/Resources/
# back up the files
sudo mkdir icon-backups
sudo cp StatusIcon_*.tiff icon-backups/
# replace all versions with the "selected" icon