Skip to content

Instantly share code, notes, and snippets.

View corbanbrook's full-sized avatar

Corban Brook corbanbrook

  • Horizon Blockchain Games
  • Toronto, Canada
  • X @corban
View GitHub Profile
@corbanbrook
corbanbrook / gist:fc5b1196aeec65655955
Last active December 1, 2015 16:32
Find all occurances of lodash functions in a bundle
cat file.js | grep "[^_]_\.[[:alpha:]]" | sed "s/.*_\.\([[:alpha:]]*\)[^[:alpha:]].*/\1/g" | sort | uniq | xargs | sed "s/ /,/g"
Outputs list like:
all,any,camelCase,capitalize,chain,clone,compact,contains,debounce,defaults,detect,difference,each,extend,filter,find,findIndex,findWhere,first,flatten,functions,groupBy,indexOf,inject,isArray,isEmpty,isEqual,isFunction,isString,keys,last,map,memoize,merge,pick,pluck,pull,reduce,reject,remove,sample,select,sortBy,startsWith,throttle,times,toArray,union,uniq,where,zip
Which can be sent to lodash-cli to create a custom build
lodash include=...
14:23:51 app | 2015/08/07 14:23:51 INFO [corban.local/AzcAPuim0X-000050] Started GET "/invites/incoming" from [::1]:63410
14:23:51 app | 2015/08/07 14:23:51 INFO Recording err runtime error: invalid memory address or nil pointer dereference
14:23:52 app | 2015/08/07 14:23:52 INFO [corban.local/AzcAPuim0X-000050] panic: runtime error: invalid memory address or nil pointer dereference
14:23:52 app | /Users/corban/Projects/go/src/github.com/zenazn/goji/web/middleware/recoverer.go:24 (0x2b0bfc)
func.005: debug.PrintStack()
/usr/local/Cellar/go/1.4/libexec/src/runtime/asm_amd64.s:401 (0x3cfe5)
call16: CALLFN(·call16, 16)
/usr/local/Cellar/go/1.4/libexec/src/runtime/panic.go:387 (0x14b28)
gopanic: reflectcall(unsafe.Pointer(d.fn), deferArgs(d), uint32(d.siz), uint32(d.siz))
/Users/corban/Projects/go/src/github.com/tobi/airbrake-go/airbrake.go:228 (0x51a8ad)
@corbanbrook
corbanbrook / gist:7dbf29476747fd42b052
Created February 2, 2015 22:18
rina's 1.4.22 apps
[BSON::ObjectId('fff800150000e7b2421168f3'), BSON::ObjectId('fff42e030000f6b03a7f5c00'), BSON::ObjectId('0010ffd60000e5bf2ff852f1'), BSON::ObjectId('001375c70000f5b68f06ccc3'), BSON::ObjectId('001cc3f80000eef138a88f50'), BSON::ObjectId('001cf7120000fcf83e1c7cd8'), BSON::ObjectId('ffe06e630000eef138a89cff'), BSON::ObjectId('ffe0a5170000eef138a89fdb'), BSON::ObjectId('ffe0b1e80000eef138a8a0d3'), BSON::ObjectId('ffe1ee320000f6fab004d8d0'), BSON::ObjectId('ffe1f3a50000f6fab004da74'), BSON::ObjectId('ffe1fed30000f6fab004dc40'), BSON::ObjectId('ffe20e2c0000f6fab004ddc1'), BSON::ObjectId('ffe344520000f7b986ee1f20'), BSON::ObjectId('ffeda3770000f4b9e80cd351'), BSON::ObjectId('fff485be0000f4ffe424b9ad'), BSON::ObjectId('fff5b26a0000efb7bab5ee96'), BSON::ObjectId('fff5dc370000f4ffe424c0d4'), BSON::ObjectId('fff71eda0000effa1d885318'), BSON::ObjectId('fff85b860000fdb54f8bedba'), BSON::ObjectId('fffc0e370000efba66f1e853'), BSON::ObjectId('fffc20710000f6f17f0a1bde'), BSON::ObjectId('00093b700000f5b827ebb04f'), BSON::Objec
2014/12/08 15:05:01 INFO [corban.local/jj7eZUWeJi-000129] Started POST "/sites/5450fb1d636f72194dbc0000/sections/545ceeec636f72031f000000/stream" from [::1]:57524
15:5:01 app | 2014/12/08 15:05:01 INFO [corban.local/jj7eZUWeJi-000129] panic: interface conversion: interface is nil, not bson.ObjectId
15:5:01 app | /Users/corban/Projects/go/src/github.com/pressly/reeler/.vendor/src/github.com/zenazn/goji/web/middleware/recoverer.go:24 (0x1cdeab)
func.006: debug.PrintStack()
/usr/local/Cellar/go/1.3.1/libexec/src/pkg/runtime/panic.c:248 (0x1078d)
panic: runtime·newstackcall(d->fn, (byte*)d->args, d->siz);
/usr/local/Cellar/go/1.3.1/libexec/src/pkg/runtime/iface.goc:292 (0x232a0)
assertE2Tret: runtime·panic(err);
/usr/local/Cellar/go/1.3.1/libexec/src/pkg/runtime/iface.goc:280 (0x23220)
assertE2T: assertE2Tret(t, e, (byte*)&retbase);
@corbanbrook
corbanbrook / gist:1da0f5986e180493a314
Created September 23, 2014 17:08
Custom tracker plugin
document.addEventListener( "DOMContentLoaded", function() {
angular.module('pressly.analytics').config(function(analyticsProvider) {
analyticsProvider.registerTracker(function() {
return {
trackPage: function(data) {
console.log("---- TRACK PAGE", data);
},
trackEvent: function(data) {
console.log("---- TRACK EVENT", data);
}
angular.module('pressly.analytics').config(function(analyticsProvider) {
analyticsProvider.registerTracker(function() {
return {
trackPage: function(data) {
console.log("---- TRACK PAGE", data);
},
trackEvent: function(data) {
console.log("---- TRACK EVENT", data);
}
};
<div data-src="DROP_PERMALINK_HERE" class="OUTBRAIN" ></div>
<script type="text/javascript">(function(){window.OB_platformType=8;window.OB_langJS="http://widgets.outbrain.com/lang_en.js";window.OBITm="1410459423314";window.OB_recMode="brn_strip";var ob=document.createElement("script");ob.type="text/javascript";ob.async=true;ob.src="http"+("https:"===document.location.protocol?"s":"")+"://widgets.outbrain.com/outbrainLT.js";var h=document.getElementsByTagName("script")[0];h.parentNode.insertBefore(ob,h);})();</script>
-- Updating [0/1190]: ziff-demo-001c31cc0000ecf73f1d5ce8 to [email protected]:pressly/ng-pressilla.git: v0.1.30.
Sending build to https://my.pressly.com/sites/001c31cc0000ecf73f1d5ce8/apps/53fe46ee4866e3950b000b6e
-- Updating [1/1190]: yourbrand1-001c52b70000ecf74f579f88 to [email protected]:pressly/ng-pressilla.git: v0.1.30.
Sending build to https://my.pressly.com/sites/001c52b70000ecf74f579f88/apps/53fe46ef4866e3950b000b9b
-- Updating [2/1190]: pkpk-001c90bb0000e7f88a76cc87 to [email protected]:pressly/ng-pressilla.git: v0.1.30.
Sending build to https://my.pressly.com/sites/001c90bb0000e7f88a76cc87/apps/53fe46ef4866e3950b000bc8
-- Updating [3/1190]: pk2014-001cb5ca0000eef28f9807e7 to [email protected]:pressly/ng-pressilla.git: v0.1.30.
Sending build to https://my.pressly.com/sites/001cb5ca0000eef28f9807e7/apps/53fe46f04866e3950b000bf5
-- Updating [4/1190]: test123-001d47690000efbd6a07fa3b to [email protected]:pressly/ng-pressilla.git: v0.1.30.
Sending build to https://my.pressly.com/sites/001d47690000efbd6a
<!-- v0.1.27 --><!DOCTYPE html>
<html ng-app="pressly" ng-cloak ng-class="[$state.includes('spotlight') ? 'px-state-spotlight' : 'px-state-stream']">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>CorbanBooBoo</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, initial-scale=1, user-scalable=no, minimal-ui">
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-8069336-43', 'auto');
ga('send', 'pageview');
</script>