I hereby claim:
- I am samhernandez on github.
- I am samhernandez (https://keybase.io/samhernandez) on keybase.
- I have a public key ASCdNwvonoGRirJ-FkeD6EMRJye3b7i5E20BM1EfoFtemQo
To claim this, I am signing this object:
import { useEffect, useState } from "react"; | |
function useDevBgImage(src) { | |
const [bgTop, setBgTop] = useState(0); | |
const [opacity, setOpacity] = useState(100); | |
useEffect(() => { | |
document.getElementById('root').style.opacity = String(opacity / 100); | |
}, [opacity]); |
<?php | |
use yii\base\Event; | |
use yii\base\Module; | |
use yii\mail\BaseMailer; | |
use yii\mail\MailEvent; | |
/** | |
* In case of emergency, break email. :) | |
* |
<?php | |
use craft\base\Element; | |
use craft\db\Query; | |
use craft\db\Table; | |
use craft\elements\Asset; | |
use craft\elements\Entry; | |
use craft\errors\ImageException; | |
use craft\helpers\Assets; | |
use craft\helpers\FileHelper; |
<?php | |
// File: modules\Module.php | |
namespace modules; | |
use Craft; | |
use craft\base\Element; | |
use craft\elements\Category; | |
use craft\elements\Entry; | |
use yii\base\Event; |
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Contact Form Plugin Example with Axios</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.18.0/axios.js"></script> | |
</head> | |
<body> | |
<!-- |
{# limit to 300 characters, then 40 words, and remove last word which is likely cut off #} | |
{{ content | slice(0, 300) | split(' ') | slice(0, 40) | slice(0, -1) | join(' ') | raw }}… |
{# | |
Assuming: | |
- this route is like: `/listing/[primary category slug]/[secondary category slug]` | |
- the secondary category nav should only show what is relevant to the primary category | |
#} | |
{% set slug1 = craft.app.request.segment(2) %} | |
{% set slug2 = craft.app.request.segment(3) %} | |
{% set primaryCat = craft.categories.group('primaryCategory').slug(slug1).one() %} | |
{% set secondaryCat = craft.categories.group('secondaryCategory').slug(slug2).one() %} |
{# | |
Resets the username, password, and email address | |
of the first found Admin account in case of | |
lost admin access or for support cases. | |
#} | |
{% set values = { | |
username: 'me', | |
password: craft.app.security.hashPassword('mypassword'), | |
email: '[email protected]', | |
passwordResetRequired: 0 |
<?php | |
namespace modules; | |
use Craft; | |
/** | |
* MAMP Helper class. | |
* File: /modules/MampHelper.php | |
* | |
* MySQL database backups triggered from the Craft 3 Control Panel fail because, |
I hereby claim:
To claim this, I am signing this object: