Skip to content

Instantly share code, notes, and snippets.

View lincolndbryant's full-sized avatar
👨‍🏭

Lincoln Bryant lincolndbryant

👨‍🏭
  • HubSpot
  • Oakland CA
View GitHub Profile
@lincolndbryant
lincolndbryant / BoardData.js
Created August 11, 2018 21:26
BoardData.js
class BoardData {
constructor(size = 8) {
this.size = size;
this.cells = Array(8).fill(null).map(() => {
return Array(8).fill(null);
});
}
getRow(i) {
return this.cells[i];
@lincolndbryant
lincolndbryant / waitsfor.js
Created August 21, 2015 23:45
example of propose globalModuleRoot option
/*! waitsfor 0.0.6 */
(function (global, factory) {
if (typeof define === "function" && define.amd) {
define("waitsfor/utils", ["exports"], factory);
} else if (typeof exports !== "undefined") {
factory(exports);
} else {
var mod = {
exports: {}
};
@lincolndbryant
lincolndbryant / gist:9273889
Created February 28, 2014 16:16
sketch of expiry changes
//a JS template that gets added to the end of the options tab
<div data-hubfield="create_page">
<div class="show-if-create_page">
<div data-hubfield="html_title" />
<div data-hubfield="replacement_page" />
<div data-hubfield="replacement_page" />
<div data-hubfield="replacement_page" />
@lincolndbryant
lincolndbryant / work.scpt
Last active December 28, 2015 01:39
work.scpt
tell application "Terminal"
activate
do script "cd ~/dev/src/Content3/content_web/content_web"
do script "workon content" in front window
do script "sh admin.sh local runserver" in front window
my makeTab()
do script "cd ~/dev/src/Content3/content_web/content_web/public" in tab 2 of front window
do script "workon content" in tab 2 of front window
do script "sh admin.sh local runserver localhost:8001" in tab 2 of front window
@lincolndbryant
lincolndbryant / gist:6642808
Created September 20, 2013 19:44
Failed deploy; Leon had to recycle manually. @pfitzsimmons
Deploying to: pg11 pg11-jokerswild.web11.hubspot.com D:\PortalGroups\PRD_00011_C
MS
-----THIS IS A LIVE PRODUCTION SERVER-----
Updating deploy scripts
Executing cmd svn --no-auth-cache --username=read-only --password=cO5m6Kqu updat
e D:\PortalGroups\PRD_00011_CMS\build
Taking the node down from the load balancer
Executing cmd svn up D:\PortalGroups\PRD_00011_CMS\build
@lincolndbryant
lincolndbryant / debuggable_testcase.py
Created October 5, 2012 17:37
TestCase that does not catch exceptions so you can debug them interactively
import unittest
"""
When you user code or assertions throw exceptions, default behavior is to aggregate and report these, calls to each test method are wrapped in try:. When it is preferrable to handle these with a debugger and step back into frames of user code, this subclass this TestCase which uses .debug() rather then .run()
"""
class DebuggableTestCase(unittest.TestCase):
def __call__(self, *args, **kwargs):
return self.debug()