Skip to content

Instantly share code, notes, and snippets.

View davekiss's full-sized avatar

Dave Kiss davekiss

View GitHub Profile
@davekiss
davekiss / gist:9af08fde4ce2d40e306a35028583d6e5
Created November 17, 2020 12:28
Cognito's Complete New Password using Amplify + React
import React, { useState, useEffect } from "react";
import Auth from "@aws-amplify/auth";
import useNotification from "hooks/useNotification";
const URLSearchParams = require("url-search-params");
import { useHistory } from "react-router-dom";
const CompleteNewPassword = props => {
const history = useHistory();
@davekiss
davekiss / gist:2639184ac066c53416b23c5a66f42d1e
Created February 2, 2019 17:44
EDD Weekly Domain Report via Email
/**
* Add a weekly email report that summarizes which domains that
* your products are being used on.
*/
add_filter( 'cron_schedules', function( $schedules ) {
$schedules['weekly'] = array(
'interval' => 604800,
'display' => __('Once Weekly')
);
@davekiss
davekiss / gist:e2b5beb37b3a1a93a3dddcf43ce51ce9
Created September 18, 2018 18:33
Display notice in EDD if email already exists and not logged in
/**
* Redirect the user to the appropriate page upon login.
*/
add_filter( 'login_redirect', function( $url, $query, $user ) {
if ( is_wp_error( $user ) ) {
return $url;
}
if ( current_user_can('administrator') ) {
return $url;
@davekiss
davekiss / RouteTransition.jsx
Created May 18, 2017 21:47 — forked from tannerlinsley/RouteTransition.jsx
Using react-move with react-router
import React, { PropTypes } from 'react'
import { Transition } from 'react-move'
const RouteTransition = React.createClass({
propTypes: {
pathname: PropTypes.string.isRequired
},
render() {
return (
@davekiss
davekiss / saga.js
Created January 31, 2017 23:55
Checking existing state in a Redux Saga
import { takeEvery } from 'redux-saga';
import { put, select } from 'redux-saga/effects';
/*
* Select data from state. The return object depends on your state shape
*/
export const getLessons = state => state.lessons;
/*
* Our worker Saga: will perform the async lessons/EDIT task
@davekiss
davekiss / gist:b35f3ed6871b7fb7612e1c66f5bf1a52
Created December 22, 2016 20:16
30 OSX Apps for a Development Laptop in 2017
Moom
Chrome
Alfred
Nylas N1/Spark
Dropbox
iTerm2
Homebrew
nvalt
Node
1password
{
"auto_complete_commit_on_tab": true,
"color_scheme": "Packages/Theme - Afterglow/Afterglow.tmTheme",
"enable_tab_scrolling": false,
"font_size": 12,
"ignored_packages":
[
"Vintage"
],
"open_files_in_new_window": false,
@davekiss
davekiss / gist:f3ee171995b156e8f1f34e0efc7370e8
Created October 25, 2016 12:58
Filter Newsletters in Gmail
# Paste into Gmail's "Has the Words" Filter Input to move
# all newsletters under their own label
"opt-out" OR unsubscribe OR "viewing the newsletter" OR "privacy policy" OR enews OR "edit your preferences" OR "email notifications" OR "update profile" OR smartunsubscribe OR secureunsubscribe OR yahoogroups OR "manage your account" OR "group-digests"
#1. Update Bootstrap compatibility in /assets/scripts/main.js
// Import npm dependencies
// import 'bootstrap/dist/js/umd/util.js';
// import 'bootstrap/dist/js/umd/alert.js';
// import 'bootstrap/dist/js/umd/button.js';
// import 'bootstrap/dist/js/umd/carousel.js';
// import 'bootstrap/dist/js/umd/collapse.js';
// import 'bootstrap/dist/js/umd/dropdown.js';
// import 'bootstrap/dist/js/umd/modal.js';
@davekiss
davekiss / 000_postgresql_fancy_datatypes
Created April 24, 2016 14:14 — forked from pcreux/000_postgresql_fancy_datatypes
Postgresql fancy datatypes with Rails / ActiveRecord. Run it with `rake`!
# Postgresql fancy datatypes!
* array
* hstore (=~ hash)
* json
* jsonb
Philippe Creux - [@pcreux](http://twitter.com/pcreux)