Skip to content

Instantly share code, notes, and snippets.

View imaustink's full-sized avatar

Austin Kurpuis imaustink

View GitHub Profile
@imaustink
imaustink / add-contributing-file.js
Last active August 11, 2017 01:17
Create a contribution file if missing
var fs = require('fs');
var path = require('path');
module.exports = {
getOptions: function () {
return [];
},
run: function (directory, opts) {
try{
@imaustink
imaustink / update-license-link.js
Last active August 15, 2017 22:49
Update license link in readme
@imaustink
imaustink / migrate-to-can-globals.js
Last active October 26, 2017 01:31
Migrate to can-globals
const fs = require('fs');
const path = require('path');
const readFile = promisify(fs.readFile);
const writeFile = promisify(fs.writeFile);
const glob = promisify(require(`glob`));
const GLOB_PATTERN = `**/*.js`;
const REPLACER_LIST = [
makeReplaceMap('global', 'js'),
makeReplaceMap('document', 'dom'),
@imaustink
imaustink / cache-failure.log
Created September 8, 2017 04:02
Evidence of cache failure
Austins-MacBook-Pro:landscaper austinkurpuis$ landscaper migrate-to-can-globals/test.json
? What should we do? Run job
/Users/austinkurpuis/bitovi/landscaper/all-repos/can-compile
[https://gist.github.com/imaustink/d1faff15b89df8fb7964c5d5c3945e72] resolved
[https://gist.github.com/imaustink/d1faff15b89df8fb7964c5d5c3945e72] applying
[https://gist.github.com/imaustink/d1faff15b89df8fb7964c5d5c3945e72] applied
/Users/austinkurpuis/bitovi/landscaper/all-repos/can-meetup
[https://gist.github.com/imaustink/d1faff15b89df8fb7964c5d5c3945e72] resolved
[https://gist.github.com/imaustink/d1faff15b89df8fb7964c5d5c3945e72] applying
[https://gist.github.com/imaustink/d1faff15b89df8fb7964c5d5c3945e72] applied
@imaustink
imaustink / can-globals-lessons-learned.md
Last active September 11, 2017 15:29
Lessons learned while publishing can-globals

Lessons learned from publishing can-globals

Recently, I published a new module to the canjs ecosystem, can-globals, and deprecated its predecessor. In doing so I broke lots of things. I've tried to recall the events to make a list of the lessons that I learned in hopes that other can learn vicariously from my mistakes.

Never integrate a module at version 0.0.x

Integrating a module that is version 0.0.x with other projects is a terrible idea, primarily because npm treats these the same as a pinned module, even if prefixed with ^. Meaning if you release a change to the module, you must then update the package.json of its dependents to reference the new version. This can also cause problems with circular dependencies; imagine you have a module with a circular dependency that is a dependent of your module, your module is namespaced, you upgrade the dependent to the latest version of your module but the circular dependency means it is still referencing the old version as well which will ca

@imaustink
imaustink / new-machine-setup.md
Created September 26, 2017 01:50
Todo list when setting up a new machine
  • Install
    • Google Chrome
    • Node.js
    • Homebrew
    • VSCode
    • Slack
    • Screen hero
    • Better snapping tool
    • 1Password
  • Change terminal default theme to homebrew
@imaustink
imaustink / update-call-expressions.js
Last active December 1, 2017 18:34
A code mod to convert helper expressions to call expressions
const fs = require('fs');
const path = require('path');
const readFile = promisify(fs.readFile);
const writeFile = promisify(fs.writeFile);
const glob = promisify(require('glob'));
const GLOB_PATTERN = `**/*.{md,html,js}`;
const EACH_AS_REGEX = /([^\}+]*)#each\s+([^\s]*)\s+as\s+([^\s|\}]*)/gm;
const HELPER_EXPRESSION_REGEX = /(\{+)(#if|#unless|#each|#with|log|deubgger|#eq|#is|#switch|#case|#default|joinbase|#routeCurrent|routeUrl)\s+([^\}]*)/gm;

There is several locations to choose from. The ribs are amazing. I would also recommend the grilled shrimp appetizer and loaded baked potato.

An amazing novelty experience with great food. Located in San Antonio on the riverwalk. The steak was good, but honesty I'd recommend the mac & cheese burger.

Fast food chain with amazing southern style, buttermilk breaded chicken. Bush puts Colonel Sanders to shame. Make sure you get some ice tea, they sell it by the gallon if you like it a lot.

Located in San Antonio near the riverwalk. A bit pricier, but worth the experience. The prime rib was incredible, they also have really good fish if that's your thing. I'd recommend the coconut breaded shrimp if you're looking for an appetizer.

@imaustink
imaustink / enumerateDevices-demo.js
Last active August 7, 2018 07:13
A demo of the enumerateDevices API
navigator.mediaDevices.enumerateDevices()
.then(devices => {
devices.forEach(device => {
console.log(`${device.kind}: ${device.label}`)
})
})