Skip to content

Instantly share code, notes, and snippets.

View lanekatris's full-sized avatar

Lane Katris lanekatris

View GitHub Profile
@lanekatris
lanekatris / gist:4484480
Last active December 10, 2015 19:58 — forked from afreeland/gist:4484102
Get angle by two vectors on a coordinate plan
/**
* Defines an x,y coordinate
* @param {float} x coordinate
* @param {float} y coordinate
*/
function Point (x, y) {
this.x = x;
this.y = y;
}
@lanekatris
lanekatris / SimpleZoomPan.js
Created January 8, 2013 15:08 — forked from afreeland/SimpleZoomPan.js
Simple Pan Zoom for canvas
{
/**
* [roundedRect description]
* @param {Canvas Context} ctx Canvas Context
* @param {int} x X Coordinate
* @param {int} y Y Coordinate
* @param {int} width Width of rectangle
* @param {int} height Height of rectangle
* @param {radius} radius Radius of rectangle corners
@lanekatris
lanekatris / iisCommands.bat
Created April 5, 2013 02:18
Useful IIS Commands
# Reset iis
iisreset
# List current sites
%systemroot%\system32\inetsrv\appcmd list app
# Change site name
%systemroot%\system32\inetsrv\appcmd set app "Default Web Site/OldApplicationName" -path:/NewApplicationName
@lanekatris
lanekatris / searchEcampusForAssignments.js
Last active December 16, 2015 05:39
Search eCampus for assignments
// Array holding our assignments
var assignments = [];
// Get raw array of assignments (a tags) (raw assignment elements)
var rawAssignmentEls = document.getElementById('vista_main_frameset')
.querySelector('frame[name="APPLICATION_FRAME"]')
.contentWindow.document.getElementById('vista_frameset')
.querySelector('frame[name="TOOLFRAME"]')
.contentWindow.document.getElementById('toolframeset')
.querySelector('frame[name="RIGHTTOOLFRAME"]')
@lanekatris
lanekatris / powershellCommands1.ps1
Last active October 19, 2016 08:21
Usefull Powershell Commands
# Import all modules available on the system
Get-Module -ListAvailable | Import-Module
# Sort directory contents
Get-ChildItem -path . | sort-object lastwritetime -descending
# Start a new powershell prompt and give it a command to execute
Start-Process powershell "-noexit -command `"cd $place`""
# Run a cmd command and capture it's output
@lanekatris
lanekatris / ie8JavaScript
Created November 5, 2013 15:06
Internet Explorer Specific JavaScript
// Find the inner width of the Window
document.documentElement.clientWidth
@lanekatris
lanekatris / jqGridSnippets.js
Last active December 30, 2015 17:29
Common jqGrid snippets
// Set jqGrid Data
$(gridEl).jqGrid('setGridParam', {data: gridData});
// Reload grid
$(gridEl).trigger('reloadGrid');
// Delete row
$(gridEl).jqGrid('delRowData', rowId);
@lanekatris
lanekatris / vimUsefulCommands
Created March 13, 2014 20:57
Vim useful commands
# Indent multiple lines
>
# Indent multiple lines
5>>
http://stackoverflow.com/questions/235839/how-do-i-indent-multiple-lines-quickly-in-vi
@lanekatris
lanekatris / angularSnippets_1.js
Last active August 29, 2015 14:06
Useful Angular.js snippets
// $http examples
$http({method: 'GET', url: '/someUrl'})
.success(function (data, status, headers, config) {
})
.error(function (data, status, headers, config) {
});
// $http.get, $http.head,$http.post,$http.put,$http.delete,$http.jsonp,$http.patch
$http.post('images/update', postData)
@lanekatris
lanekatris / AppFabric_PowerShell_Snippets.ps1
Last active August 29, 2015 14:26
Some useful commands working with AppFabric
# View all AppFabric CmdLets
Get-Command –module ApplicationServer
# Create help documentation for all AppFabric CmdLets
Get-Command –module ApplicationServer | Sort-Object Verb,Noun | Get-Help -detailed > C:\temp\HelpTopicsSortedNounVerb.txt