Skip to content

Instantly share code, notes, and snippets.

💯
🤠 coder

Kurt Milam kurtmilam

💯
🤠 coder
Block or report user

Report or block kurtmilam

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kurtmilam
kurtmilam / deep_extend_javascript_objects_underscore_mixin.js
Last active Apr 13, 2018
Deep Extend / Merge Javascript Objects - underscore.js Mixin
View deep_extend_javascript_objects_underscore_mixin.js
/* Copyright (C) 2012-2014 Kurt Milam - http://xioup.com | Source: https://gist.github.com/1868955
*
* This mixin now has its own github repository: https://github.com/kurtmilam/underscoreDeepExtend
* It's also available through npm and bower
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFR
@kurtmilam
kurtmilam / lazy_memoize_javascript_object_property_underscore_mixin.js
Last active Dec 16, 2015
Underscore.js mixin: lazily memoize an object property
View lazy_memoize_javascript_object_property_underscore_mixin.js
/* Copyright (C) 2012-2013 Kurt Milam - http://xioup.com | Source: https://gist.github.com/5442982
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TO
@kurtmilam
kurtmilam / extract_ruby_json_inner_values_underscore_javascript.js
Last active Dec 21, 2015
Extract inner values from Ruby JSON (javascript/underscore)
View extract_ruby_json_inner_values_underscore_javascript.js
/* Copyright (C) 2012-2013 Kurt Milam - http://xioup.com | Source: https://gist.github.com/6316082
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TO
@kurtmilam
kurtmilam / gravity_forms_custom_webhooks.php
Last active Dec 21, 2015
Create custom webhooks for Gravity Forms submissions
View gravity_forms_custom_webhooks.php
/* Copyright (C) 2012-2014 Kurt Milam - http://xioup.com | Source: https://gist.github.com/6316124
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TO
@kurtmilam
kurtmilam / Webfaction-CouchDB-config.log
Created Jul 8, 2014
config.log for CouchDB 1.6.0 installation on Webfaction
View Webfaction-CouchDB-config.log
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by Apache CouchDB configure 1.6.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ ./configure --prefix=/home/USER --with-js-lib=/home/USER/lib --with-js-include=/home/USER/include/js --with-erlang=/home/USER/lib/erlang/usr/include
## --------- ##
## Platform. ##
@kurtmilam
kurtmilam / slenderize_flatten_javascript_object_.js
Last active Jul 31, 2018
Underscore/Lodash slenderize / flatten object mixin
View slenderize_flatten_javascript_object_.js
/* Copyright (C) 2014 Kurt Milam - http://xioup.com | Source: https://gist.github.com/kurtmilam/7006dc1c2123787f9679
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTI
@kurtmilam
kurtmilam / make promise wait for property
Last active Nov 6, 2017
Make a promise wait for a specific object property to be set
View make promise wait for property
// Semi reusable factory for promises waiting on an object property to be defined
function waitForIt (objectToObserve, propertyToObserve) {
return new Promise(function (resolve, reject) {
var checkIt = function (objectToObserve, propertyToObserve){
if (typeof objectToObserve[propertyToObserve] == 'undefined'){
setTimeout(checkIt, 500, objectToObserve, propertyToObserve)
} else {
resolve(objectToObserve[propertyToObserve])
}
}
@kurtmilam
kurtmilam / deep_compact_javascript_objects_underscore_lodash_mixin
Last active Apr 16, 2016
Underscore.js / Lodash Mixin to deep compact an object
View deep_compact_javascript_objects_underscore_lodash_mixin
/*The MIT License (MIT)
Copyright (c) 2014 Kurt Milam - http://xioup.com | Source: https://gist.github.com/kurtmilam/886b705fb0eb03001c77
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN AC
@kurtmilam
kurtmilam / gist:012b95c9def2723049f9
Created Nov 3, 2014
Handlebars Helpers & Nodejs Trouble
View gist:012b95c9def2723049f9
Handlebars.registerHelper("testHelper", function(options) {
console.log('testHelper')
return 'testHelper'
})
var template = "{{testHelper}}"
var ret = Handlebars.parse(template).statements
if (typeof ret[0] == 'undefined' || typeof ret[0].type == 'undefined' || ret[0].type != 'content') {
console.log('tags', ret, 'template', template)
View PackageVersionNumbers
When you're ready to publish to bower, NPM, etc., do the following:
1. Figure out what the new NPM version number will be (semver major.minor.patch)
2. Update the version numbers to the (soon to be) new NPM version number in bower.json, component.json, etc. (but not in package.json)
3. Commit the repo with a message like "Updated version number in bower and component.json"
4. Run the NPM version command:
> npm version major|minor|patch|[new version number] -m "Updating NPM version"
//This step updates the version number in package.json. If you did steps 1-3 correctly, the version number in package, bower and component.json should be the same
5. Run the NPM publish command:
> npm publish
You can’t perform that action at this time.