Skip to content

Instantly share code, notes, and snippets.

View courcelan's full-sized avatar

Cobey Potter courcelan

View GitHub Profile
@courcelan
courcelan / iconify.js
Created June 1, 2020 16:03
pul icon names from yaml file and load into vue
import upperFirst from "lodash/upperFirst"
import camelCase from "lodash/camelCase"
import icons from "./_icons.yaml"
const requireSvgComponent = require.context(
"./",
false,
/[A-Z]\w+\.(svg)$/
)
@courcelan
courcelan / useStopOnUnsavedData.js
Last active December 4, 2019 04:56
window on unload helper to test for unsaved data on the page. created for reuse in various components and views, and a gentle step towards Vue 3
const confirmationMessage = "Warning: Leaving this page will result in any unsaved data being lost. Are you sure you wish to continue?"
let editorData = Vue.observable({
original: "",
current: ""
})
export const assignDataCheck = (packagedData, type = "original") => editorData[type] = JSON.stringify(packagedData)
export default (data) => {
export default (event) => {
const $el = event.target.closest('a')
const { hostname, port } = document.location
if (
event.defaultPrevented || // disables this behavior
event.which !== 1 || // not a left click
event.metaKey ||
event.altKey ||
event.ctrlKey ||
const sortCSSmq = require('sort-css-media-queries')
module.exports = {
...
css: {
loaderOptions: {
postcss: {
plugins: [
require('css-mqpacker')({ sort: sortCSSmq }),
]
@courcelan
courcelan / .eslintrc.js
Created September 28, 2019 02:40 — forked from nkbt/.eslintrc.js
Strict ESLint config for React, ES6 (based on Airbnb Code style)
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": ["react"],
"ecmaFeatures": {
@courcelan
courcelan / gist:08f6519bff23bc2831c8538b0397eb24
Created July 19, 2019 15:15
collections api server error
KeyError at /content/r/collections/config/4039/
11618
Request Method: POST
Request URL: http://localhost:8000/content/r/collections/config/4039/
Django Version: 1.11.21
Exception Type: KeyError
Exception Value: 11618
Environment:

Keybase proof

I hereby claim:

  • I am courcelan on github.
  • I am cobeypotter (https://keybase.io/cobeypotter) on keybase.
  • I have a public key ASBQsnk0NKUS8JIHV3-B-jObzTC0LYDSf9Z8gJlTL7BJYAo

To claim this, I am signing this object:

Unhandled exception in thread started by <bound method Command.inner_run of <django.contrib.staticfiles.management.commands.runserver.Command object at 0x101f0dd90>>
Traceback (most recent call last):
File "/Users/Cobey/Virtualenvs/cis/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 91, in inner_run
self.validate(display_num_errors=True)
File "/Users/Cobey/Virtualenvs/cis/lib/python2.7/site-packages/django/core/management/base.py", line 266, in validate
num_errors = get_validation_errors(s, app)
File "/Users/Cobey/Virtualenvs/cis/lib/python2.7/site-packages/django/core/management/validation.py", line 30, in get_validation_errors
for (app_name, error) in get_app_errors().items():
File "/Users/Cobey/Virtualenvs/cis/lib/python2.7/site-packages/django/db/models/loading.py", line 158, in get_app_errors
self._populate()
(idlp)Yggdrasil:/Volumes/Wellfire/ilt/ilt-insightdlp$ ./promote
/Users/Cobey/.heroku/client/lib/heroku/helpers.rb:93: warning: Insecure world writable dir /usr/local/heroku/bin in PATH, mode 040777
! No app specified.
! Run this command from an app folder or specify which app to use with --app APP.
Is this ready to promote to production? (y/n) y
Promoting to production...
/Users/Cobey/.heroku/client/lib/heroku/helpers.rb:93: warning: Insecure world writable dir /usr/local/heroku/bin in PATH, mode 040777
! No app specified.
! Run this command from an app folder or specify which app to use with --app APP.