Skip to content

Instantly share code, notes, and snippets.

View doublejosh's full-sized avatar
🎰
front-ending

Josh Lind doublejosh

🎰
front-ending
View GitHub Profile
const fields = [{ name: "email", value: "" }];
const hiddenFields = [
{ name: "lists", value: "waitlist" },
{ name: "source", value: "twitter" },
{ name: "medium", value: "social" },
{ name: "campaign", value: "header" },
{ name: "campaign_type", value: "website" },
];
const urlParams = new URLSearchParams(window.location.search);
@doublejosh
doublejosh / Wrapper.tsx
Created May 5, 2020 20:04
Typescript + MUI + Styled
const MyComponent: React.FC<{ theme: MyTheme }> = styled(({ theme, ...props }) => <Box {...props} />)`
&& {
text-align: center;
padding-top: ${props => props.theme.spacing(2)}px;
}
`
export const Wrapper: React.FC<WrapperProps> = ({ ...props }) => {
const theme: MyTheme = useTheme()
return (
@doublejosh
doublejosh / app-market.json
Last active June 11, 2018 18:47
DroneDeploy App Market - Featured Apps
[{
"org": "EZ3D",
"image": "/img/ez3dShowcase.jpg",
"summary": "Use EZRoof reports to view roof condition and generate measurements for creating precise estimates to repair or modify roofs.",
"segments": ["Developer"]
}, {
"org": "SLANTRANGE",
"image": "/img/slantrangeShowcase.jpg",
"summary": "Download field boundaries from flight plans &amp; import directly into SLANTRANGE analytics software for automatic cropping of maps.",
"segments": ["Agriculture", "Developer"]
@doublejosh
doublejosh / eloqua_tracking_script_jquery.js
Created December 8, 2017 21:44
Eloqua tracking script - Namespacing (jQuery flavor)
/**
* @file Eloqua visitor tracking (jQuery flavor).
*/
var Eloqua = window.Eloqua || {};
(function(Eloqua, $, window, _elqQ) {
Eloqua.timerId = null;
Eloqua.timeout = 5;
@doublejosh
doublejosh / eloqua_tracking_script.js
Last active December 8, 2017 21:36
Eloqua tracking script - slightly better namespacing
/**
* @file Eloqua visitor tracking.
*/
var Eloqua = Eloqua || {};
(function(Eloqua, window, _elqQ) {
Eloqua.timerId = null;
Eloqua.timeout = 5;
@doublejosh
doublejosh / metalsmith-plugin-template.js
Last active October 16, 2017 06:29
Install via metalsmith-plugin-template/index.js
/**
* @file Plugin template.
*
* @example
* var myPlugin = require('./plugins/my-plugin');
* Metalsmith(__dirname)
* .source('./src')
* .destination('./build')
* .use(myPlugin())
* .build(function(err) {});
@doublejosh
doublejosh / odometer.html
Last active October 4, 2017 18:47
Odometer Setup
<html>
<head>
<link rel="stylesheet" href="css/odometer-theme-default.css" media="screen" charset="utf-8">
<style>
.odometer.odometer-animating-up .odometer-ribbon-inner,
.odometer.odometer-animating-down.odometer-animating .odometer-ribbon-inner {
transition-duration: 1s !important;
}
</style>
</head>
@doublejosh
doublejosh / wistia_close_popover_end.js
Created September 28, 2017 01:39
Wistia video close
/**
* Close video popup at the end automatically.
*/
(function () {
window._wq = window._wq || [];
// Access video object on page by ID.
_wq.push({id: "MY_VIDEO_ID", onReady: function (video) {
video.bind("end", function (t) {
video.popover.hide();
});
@doublejosh
doublejosh / add_menu_items.php
Created July 12, 2017 01:43
Add Drupal menu items with hierarchy (not working right)
/**
* Set the parent of menu items via name.
*
* @param string $menu_name
* Machine name of the menu.
* @param string $item_name
* Title of the menu link to use as the new parent.
* @param array $children
* List of menu item (mlids) to nest under parent.
*/
@doublejosh
doublejosh / visbile_by_param.js
Last active March 18, 2017 01:54
Param visibility
/**
* Reveal content based on param value.
*
* @param {object} options
* @property {string} paramName
* @property {string} regex
* @property {string} selector
*/
function paramVisible(options) {
var urlObj = Tabia.util.parseUrl(),