Skip to content

Instantly share code, notes, and snippets.

View mindmergedesign's full-sized avatar

Juan Giraldo mindmergedesign

View GitHub Profile

Access macOS localhost from IE or Edge within Parallels Desktop

This issue is so infuriating that I'm going to take some time to write about it.

  1. MOST IMPORTANT. Your local development server must be bound to IP address 0.0.0.0. Some do this by default, but many don't. You need to make sure that you run your local server with correct IP bindings. You may need to provide additional flags to your serve commands e.g. polymer serve --hostname domain.local, hugo serve --bind 0.0.0.0. If you use a named domain like domain.local, it has to be defined in /etc/hosts and pointing at 0.0.0.0.

  2. My Parallels setting is using Shared Network, nothing special there.

  3. Open macOS Terminal and type ifconfig. Look for the value under vnic0 > inet. It is typically 10.211.55.2.

Thank you for contacting Company Name.
===================
Full Name: {{ full_name }}
Phone Number: {{ phone_number }}
Email Address: {{ email_address }}
Message: {{ message }}
---
@mindmergedesign
mindmergedesign / theme-ui-tailwind.js
Last active March 25, 2020 15:46
Theme-UI Tailwind Congig
{
"borderWidths": {
"0": "0",
"2": "2px",
"4": "4px",
"8": "8px",
"px": "1px"
},
"breakpoints": [
"640px",
@mindmergedesign
mindmergedesign / git-pushing-multiple.rst
Created July 7, 2019 02:35 — forked from rvl/git-pushing-multiple.rst
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

import React from 'react'
import styled from 'styled-components'
class ScrollingWrapper extends React.Component {
state = { hasScrolled: false }
componentDidMount() {
this.scrollingWrapper.addEventListener('scroll', this.onScroll)
}
@mindmergedesign
mindmergedesign / slugify.js
Created February 2, 2019 17:22 — forked from mathewbyrne/slugify.js
Javascript Slugify
function slugify(text)
{
return text.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/\-\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of text
}
@mindmergedesign
mindmergedesign / netlify.php
Created January 28, 2019 17:03 — forked from freddiemixell/netlify.php
WordPress Netlify Build Hook
<?php
// Netlify Webhook Build Function
// -- this function will trigger a rebuild on post update
// -- add your api key or url below
add_action( 'save_post', 'netlify_rebuild');
function netlify_rebuild( $post_id ) {
if ( wp_is_post_revision( $post_id ) ) {
return;
}
@mindmergedesign
mindmergedesign / Statamic+Tailwind+PurgeCSS.md
Created June 12, 2018 14:39 — forked from binoclard/Statamic+Tailwind+PurgeCSS.md
Fresh Statamic install, with Tailwind CSS and PurgeCSS configured

In 5 minutes, you’ll have a brand new clean Statamic site, with Tailwind CSS and PurgeCSS configured.

It assumes that you work on a Mac, you put your site in ~/sites and you use Laravel Valet.

All the credit go to Jack McDade and philipboomy, from whom I stole and adapt the build scripts and the PurgeCSS config, this is only a detailed write up of the process.

You'll need Yarn and Node. You can install them both in one command via Brew: brew install yarn

@mindmergedesign
mindmergedesign / troubleshooting.md
Created March 15, 2018 21:51 — forked from adamwathan/troubleshooting.md
Troubleshooting Valet on macOS Sierra

Troubleshooting Valet on Sierra

Common Problems

Problem: I just see "It works!"

Apache is running on port 80 and interfering with Valet.

  1. Stop Apache: sudo /usr/sbin/apachectl stop
  2. Restart Valet: valet restart