Skip to content

Instantly share code, notes, and snippets.

View jeffgabhart's full-sized avatar

Jeff Gabhart jeffgabhart

View GitHub Profile
@jeffgabhart
jeffgabhart / weasyprint_complex_headers.py
Created October 27, 2016 20:56 — forked from pikhovkin/weasyprint_complex_headers.py
Repeat on each page of complex headers (eg, tables) except the first page
# coding: utf-8
from weasyprint import HTML, CSS
def get_page_body(boxes):
for box in boxes:
if box.element_tag == 'body':
return box
@jeffgabhart
jeffgabhart / moment.js
Created April 21, 2015 16:57
Moment JQuery
$('.moment-fmt').each(function() {
var format = $(this).data('moment-fmt') || '';
var date = $(this).data('moment') || '';
if (date.length) {
date = moment.utc(date).local();
if (format.length) {
$(this).text(date.format(format));
} else {
$(this).text(date);
}
@jeffgabhart
jeffgabhart / recordsetDump.vb
Last active August 29, 2015 14:17
Visual Basic 6 Recordset Dump
'Change myRecordset to the recordset you want to dump
'Paste into Immediate
Set rec = myRecordset.Clone: rec.MoveFirst: Do Until rec.EOF: For Each f In rec.Fields: Debug.Print f.Name & " [" & f.Type & "](" & f.DefinedSize & "): " & f.Value: Next: Debug.Print "": rec.MoveNext: Loop: Set rec = Nothing
// Facebook SDK
angular.module('facebook', [])
.directive('fb', ['$FB', function($FB) {
return {
restrict: "E",
replace: true,
template: "<div id='fb-root'></div>",
compile: function(tElem, tAttrs) {
return {
post: function(scope, iElem, iAttrs, controller) {
@jeffgabhart
jeffgabhart / gist:6978509
Last active December 25, 2015 12:39 — forked from assaframan/gist:3079570
Get Facebook Friends
public class Friend
{
public String Id { get; set; }
public String Name { get; set; }
};
private class Paging
{
public String next { get; set; }
@jeffgabhart
jeffgabhart / Typeahead-BS3-css
Last active December 20, 2015 13:39 — forked from bhays/Typeahead-BS3-css
0.10.0 updates
.twitter-typeahead {
display: block !important;
}
.twitter-typeahead .tt-query,
.twitter-typeahead .tt-hint {
margin-bottom: 0;
}
.tt-hint {
display: block;
width: 100%;
@jeffgabhart
jeffgabhart / services.js
Created January 8, 2013 20:14
AngularJS Services Pattern
var services = angular.module('services', []);
services.factory('catalog' ['$http', function($http) {
var catalog = {};
catalog.init = function() {
return $http.get('/api/catalog').then(function (response) {
angular.extend(catalog, response.data);
});
};
@jeffgabhart
jeffgabhart / gist:4338140
Created December 19, 2012 16:43
Visual Studio 2012 Disable Attach Security Warning
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\Debugger
DisableAttachSecurityWarning=1
@jeffgabhart
jeffgabhart / console.xml
Last active October 13, 2015 00:58 — forked from jonschoning/console.xml
console2
<?xml version="1.0"?>
<settings>
<console change_refresh="10" refresh="100" rows="50" columns="80" buffer_rows="9999" buffer_columns="0" shell="" init_dir="C:\code" start_hidden="0" save_size="0">
<colors>
<color id="0" r="45" g="45" b="45"/>
<color id="1" r="102" g="153" b="204"/>
<color id="2" r="153" g="204" b="153"/>
<color id="3" r="102" g="204" b="204"/>
<color id="4" r="242" g="119" b="122"/>
<color id="5" r="204" g="153" b="204"/>
@jeffgabhart
jeffgabhart / .bashrc
Created January 20, 2010 15:59
Show git branch in prompt
PS1='\[\033[1;33m\]\W\[\033[1;37m\]`__git_ps1` \[\033[0m\]\n$ '