Skip to content

Instantly share code, notes, and snippets.

View rebz's full-sized avatar
👽
Get me outta here!

Chris Johnson rebz

👽
Get me outta here!
  • Indianapolis, IN
View GitHub Profile
@rebz
rebz / Abstracting Routes
Created October 17, 2020 14:53
Example of progressive abstraction for routes in a Node Express application.
// OPTION 1
router.get('/user', function(req, res) {
res.send('yay')
})
// OPTION 2
@rebz
rebz / Component.js
Created July 15, 2019 22:57
Vue VNode Constructor
import Vue from 'vue';
import VNode from './VNode';
export default {
const VNodeArray = this.$slots.head;
const item = VNodeArray[0];
const DetailConstructor = Vue.extend(VNode);
const rendered = new DetailConstructor({
@rebz
rebz / v-click-outside
Created April 13, 2019 20:28
Custom directive to drop in a project for Modal-esque elements.
/*
* Add `v-click-outside="function"` to your element.
* Does not take into account 'touchstart'
*/
export default {
bind: function (el, binding, vnode) {
el.event = function (event) {
if (!(el == event.target || el.contains(event.target))) {
vnode.context[binding.expression](event);
#ENV: {"SHELL":"/bin/zsh","TMPDIR":"/var/folders/rx/n0_7vt1d38lc0qfk_9z2mf8c0000gn/T/","Apple_PubSub_Socket_Render":"/private/tmp/com.apple.launchd.S6BgqQznsE/Render","USER":"username","SSH_AUTH_SOCK":"/private/tmp/com.apple.launchd.SUtF1LD0tc/Listeners","__CF_USER_TEXT_ENCODING":"0x1F5:0x0:0x0","GOOGLE_API_KEY":"AIzaSyAQfxPJiounkhOjODEO5ZieffeBv6yft2Q","PATH":"/usr/local/opt/[email protected]/bin:/Users/username/.nvm/versions/node/v8.11.3/bin:/usr/local/sbin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/username/.composer/vendor/bin:/Users/username/.composer/vendor/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:","PWD":"/","XPC_FLAGS":"0x0","XPC_SERVICE_NAME":"com.progress.nativescriptsidekick.13064","SHLVL":"1","HOME":"/Users/username","LOGNAME":"username","SECURITYSESSIONID":"186a9","OLDPWD":"/","LANG":"en_US.UTF-8","SWIFT_VERSION":"4","EDITOR":"vim","HISTSIZE":"50000","HISTFILESIZE":"32768","HISTCONTROL":"ignoredups","HISTIGNORE":"ls:cd:cd -:pwd:exit:date:* --help","LC_ALL":"en_US.UTF-8","
[19-03-03 10:35:41.699] (Info) ab.actionsLogger.shell.appVersion - {"name":"NativeScript Sidekick","version":"1.16.1-v.2019.2.27.1"}
[19-03-03 10:35:41.705] (Info) ab.analytics.shell.clientId - No value provided
[19-03-03 10:35:41.719] (Info) ab.appContext.shell.appContext - No value provided
[19-03-03 10:35:41.720] (Info) ab.appContext.shell.projectType - No value provided
[19-03-03 10:35:41.721] (Info) ab.appContext.shell.isProjectShared - No value provided
[19-03-03 10:35:41.733] (Info) ab.appValidityWatcher.shell.isAppValid - No value provided
[19-03-03 10:35:41.750] (Info) ab.buildDeploy.shell.buildConfigChanged - {"platform":null,"buildType":"Cloud","buildConfig":"Debug","isClean":false,"useSharedCloud":false,"webpack":{"isWebpack":false,"env":{"uglify":true,"snapshot":true,"aot":{"debug":false,"release":true},"sourceMap":false}},"isHmr":false}
[19-03-03 10:35:41.753] (Info) ab.buildDeploy.shell.isWebpackSupported - No value provided
[19-03-03 10:35:41.754] (Info) ab.buildDeploy.shell.isWebpackInPreview
[19-03-02 13:49:35.541] Build started.
[19-03-02 13:49:39.670] (CLI) Running webpack for iOS...
[19-03-02 13:49:40.643] (CLI) Bundling application for entryPath ./main.js...
[19-03-02 13:49:40.736] (CLI) clean-webpack-plugin: /Users/username/Code/nscript/platforms/ios/nscript/app/**/* has been removed.
[19-03-02 13:49:40.770] (CLI) File change detected. Starting incremental webpack compilation...
[19-03-02 13:49:40.789] (CLI) webpack is watching the files…
[19-03-02 13:49:46.138] (CLI) Hash: {hash_var}
[19-03-02 13:49:46.138] (CLI) Version: webpack 4.29.5
[19-03-02 13:49:46.138] (CLI) Time: 5355ms
[19-03-02 13:49:46.138] (CLI) Built at: 2019-03-02 13:49:46