Skip to content

Instantly share code, notes, and snippets.

View gtallen1187's full-sized avatar
🤪

Greg Allen gtallen1187

🤪
View GitHub Profile
@gtallen1187
gtallen1187 / gfm.rb
Created November 20, 2013 22:54 — forked from mojombo/gfm.rb
require 'digest/md5'
def gfm(text)
# Extract pre blocks
extractions = {}
text.gsub!(%r{<pre>.*?</pre>}m) do |match|
md5 = Digest::MD5.hexdigest(match)
extractions[md5] = match
"{gfm-extraction-#{md5}}"
end
@gtallen1187
gtallen1187 / auto-date (qq)
Created November 20, 2013 23:04
date automatically fast-forwards to the end of the current quarter
where datediff(day,enc.encounterdate,(dateadd(qq,datediff(qq,0,getdate())+1,0))) between 0 and 365
@gtallen1187
gtallen1187 / 0_reuse_code.js
Created November 23, 2013 18:15
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
function throttle( fn, time ) {
var t = 0;
return function() {
var args = arguments, ctx = this;
clearTimeout(t);
t = setTimeout( function() {
fn.apply( ctx, args );
}, time );
};
<img src="thermometer.svg" class="svg-inject">
|
<ul class="menu">
<li><a href="#1">Hot</a></li>
<li><a href="#0.66">Warm</a></li>
<li><a href="#0.33">Chilly</a></li>
<li><a href="#0">Cold</a></li>
</ul>
if WScript.Arguments.Count < 2 Then
WScript.Echo "Error! Please specify the source path and the destination. Usage: XlsToCsv SourcePath.xls Destination.csv"
Wscript.Quit
End If
Dim oExcel
Set oExcel = CreateObject("Excel.Application")
Dim oBook
Set oBook = oExcel.Workbooks.Open(Wscript.Arguments.Item(0))
oBook.SaveAs WScript.Arguments.Item(1), 6
oBook.Close False
<div id="btc-quote"></div>
<script type="text/javascript" src="//cdn-gh.firebase.com/btcquote/embed.js"></script>
var myStylesLocation = "http://www.gregdevtest.net/bootstrap/dist/css/bootstrap.min.css";
$('<style type="text/css"></style>')
.html('@import url("' + myStylesLocation + '")')
.appendTo("head");
@gtallen1187
gtallen1187 / createISNUMERICfunction.sql
Last active August 29, 2015 13:55
syntax for creating function in PG for isnumeric
CREATE FUNCTION isnumeric(text) RETURNS boolean AS '
SELECT $1 ~ ''^[0-9]+$''
' LANGUAGE 'sql';