Skip to content

Instantly share code, notes, and snippets.

View mindmergedesign's full-sized avatar

Juan Giraldo mindmergedesign

View GitHub Profile
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
@mindmergedesign
mindmergedesign / ajaxBearer.js
Created November 1, 2017 21:27 — forked from alikrc/ajaxBearer.js
ajax post with bearer token
$.ajax({
url: "http://localhost:33460/api/Account/userinfo",
dataType: 'json',
data: {
foo: 'bar'
},
success: function(data, status) {
return console.log("The returned data", data);
},
beforeSend: function(xhr, settings) { xhr.setRequestHeader('Authorization','Bearer ' + tokenString ); } //set tokenString before send
@mindmergedesign
mindmergedesign / setup.md
Created October 12, 2017 18:22 — forked from shashankmehta/setup.md
Setup PHP and Composer on OSX via Brew

First install Brew on your MAC

  • Setup Brew: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • brew update
  • brew tap homebrew/dupes
  • brew tap homebrew/php
  • Install PHP 7.0.+ brew install php70
  • Install mcrypt: brew install mcrypt php70-mcrypt
  • Finally, install composer: brew install composer
@mindmergedesign
mindmergedesign / main.js
Created September 14, 2017 16:12 — forked from unr/main.js
Simplistic Axios in VueJs Example
const axiosconfig = {
baseurl: 'https://site.com/api/',
timeout: 30000,
};
import Vue from 'vue';
import axios from 'axios';
// Setting up Axios on Vue Instance, for use via this.$axios
Vue.prototype.$axios = axios.create(axiosConfig);
@mindmergedesign
mindmergedesign / country-list.html
Created September 8, 2017 18:10 — forked from yogasukma/country.html
List Of country
<option>Select Your Country</option>
<option value="Afghanistan">Afghanistan</option>
<option value="Albania">Albania</option>
<option value="Algeria">Algeria</option>
<option value="American Samoa">American Samoa</option>
<option value="Andorra">Andorra</option>
<option value="Angola">Angola</option>
<option value="Anguilla">Anguilla</option>
<option value="Antarctica">Antarctica</option>
<option value="Antigua and Barbuda">Antigua and Barbuda</option>