Skip to content

Instantly share code, notes, and snippets.

View jeremysimmons's full-sized avatar

Jeremy Simmons jeremysimmons

View GitHub Profile
Just go to http://closure-compiler.appspot.com/
// ==ClosureCompiler==
// @compilation_level ADVANCED_OPTIMIZATIONS
// @output_file_name default.js
// @use_closure_library true
// ==/ClosureCompiler==
goog.require('goog.json');
if (!window['JSON']) window['JSON']={};
@jeremysimmons
jeremysimmons / gist:6072578
Created July 24, 2013 17:19
linux: sum list of numbers
awk '{total = total + $1}END{print total}'
@jeremysimmons
jeremysimmons / gist:6072729
Created July 24, 2013 17:40
linux: sum of svn directory sizes
find . -regex '.+svn$' -print0 | xargs -0 -n 1 du -shk | cut -f 1 | awk '{total = total + $1}END{print total}'
@jeremysimmons
jeremysimmons / gist:7645294
Created November 25, 2013 17:41
visual studio alias
alias ccc Test.CodeCoverage.ShowCodeCoverageColoring
alias ccr Test.CodeCoverageResults
<script type="text/javascript">
//Stop Form Submission of Enter Key Press
function stopRKey(evt) {
var evt = (evt) ? evt : ((event) ? event : null);
var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
// if the keyCode was Enter, and node that caused event was not a textarea, submit or button, cancel the event
if (evt.keyCode == 13 && node.type != "textarea" && node.type != 'submit' && node.type != 'button') { return false; }
}
document.onkeypress = stopRKey;
</script>
@jeremysimmons
jeremysimmons / csv head.ps1
Created August 19, 2014 16:36
powershell csv import skip lines
$csvPath = 'C:\Temp\Whatever.csv'
$csvData = Get-Content -Path $csvPath | Select-Object -Skip 2 | ConvertFrom-Csv
<?xml version="1.0" encoding="UTF-8"?>
<TestSettings name="Parallel" id="75d1bdb9-bbc6-4a1f-81d3-001163492e2e" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
<Deployment enabled="false" />
<Description>Parallel test run</Description>
<Execution parallelTestCount="0">
<TestTypeSpecific>
<UnitTestRunConfig testTypeId="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b">
<AssemblyResolution>
<TestDirectory useLoadContext="true" />
</AssemblyResolution>
<script type="text/javascript">
$(function() {
$('.collapse').on('show.bs.collapse', function (e) {
$(e.target).siblings("button[data-toggle=collapse]").children("span").removeClass("glyphicon-chevron-down").addClass("glyphicon-chevron-up");
});
$('.collapse').on('hide.bs.collapse', function (e) {
$(e.target).siblings("button[data-toggle=collapse]").children("span").removeClass("glyphicon-chevron-up").addClass("glyphicon-chevron-down");
});
});
</script>
WITH
cte1 AS
(
SELECT
HeaderID
,An_ID
,Year
,YearSequence
,Value
,ValueType
@jeremysimmons
jeremysimmons / breadcrumbs.css
Last active January 4, 2017 20:42 — forked from alexisnomine/breadcrumbs.css
Breadcrumb when navigating folders in a Sharepoint 2010 Document Library WebPart.(Pure JS, No jQuery, IE8+) Can be inserted via a "HTML Content Editor Web Part" or referenced in a custom masterpage.
.ms-WPHeader .breadcrumbs{
display:block;
font-style:italic;
}
.ms-WPHeader .breadcrumbs,.ms-WPHeader .breadcrumbs a{
font-size: 0.8em;
color:#D1D1D1;
}