Skip to content

Instantly share code, notes, and snippets.

@trezy
trezy / Collapsable.vue
Last active March 27, 2019 18:53
Weird Nuxt SSR issue
<template>
<div class="collapsable">
<input
:id="`${id}::collapsable-control`"
:name="[`${group}`]"
:type="[`${group ? 'radio' : 'checkbox'}`]" />
<label
v-on:click="handleClick"
:for="`${id}::collapsable-control`">
// Module imports
import fs from 'fs'
import path from 'path'
function exportDirectory (requirePath) {
let exports = {}
@trezy
trezy / blep.js
Last active April 13, 2019 07:20
// This is just a mock for our original command
const string = '!projects-add -f flag -b "Kirk\'s awesome string" -b "Kirk\'s awesome string" -b "Kirk\'s awesome string" something that won\'t work -r 999';
// Placeholder for the original command string as we replace string arguments
let stringWithReplacedArgs = string
// Use `.match()` to extract an array of all string arguments
const stringArgs = string.match(/(".*?")/g)
// Loop over the array of string args and make sure they're replaced with the appropriate index in our replaced string
-- Get current sprite
local sourceSprite = app.activeSprite
-- Exit if we're not currently looking at a sprite
if not sourceSprite then
return app.alert("There is no active sprite")
end
-- Initiate the important variables
local executionDialog = Dialog("AwesomeExport is creating your sprite... ")

Keybase proof

I hereby claim:

  • I am trezy on github.
  • I am trezy (https://keybase.io/trezy) on keybase.
  • I have a public key ASDVjqCniDrZPVWFpJgs6OZeCxDriLqp1QwSOQrZY6G-YAo

To claim this, I am signing this object:

JavaScript β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘ Pretty Good
HTML β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ Totally Solid
CSS β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ πŸ’―
React.js β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘ Good
Muscle β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ Meh
Drums β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘ Strong (probs rusty, tho)
// Module imports
import {
createContext,
useCallback,
useContext,
useEffect,
useState,
} from 'react'
import PropTypes from 'prop-types'
// pages/newsletter.js
function NewsletterPage() {
const [email, setEmail] = useState('')
const [error, setError] = useState(false)
const [isSubmitted, setIsSubmitted] = useState(false)
const [isSubmitting, setIsSubmitting] = useState(false)
const [name, setName] = useState('')
const handleEmailChange = useCallback(({ target }) => {
// Module imports
import React from 'react'
// Local imports
import ExternalLink from 'components/ExternalLink'
import {
cloneElement,
useCallback,
} from 'react'
function RadioGroup(props) {
const {
children,
onChange,
} = props