Skip to content

Instantly share code, notes, and snippets.

Dave Kiss davekiss

View GitHub Profile
@davekiss
davekiss / gist:2639184ac066c53416b23c5a66f42d1e
Created Feb 2, 2019
EDD Weekly Domain Report via Email
View gist:2639184ac066c53416b23c5a66f42d1e
/**
* 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 Sep 18, 2018
Display notice in EDD if email already exists and not logged in
View gist:e2b5beb37b3a1a93a3dddcf43ce51ce9
/**
* 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 — forked from tannerlinsley/RouteTransition.jsx
Using react-move with react-router
View RouteTransition.jsx
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 Jan 31, 2017
Checking existing state in a Redux Saga
View saga.js
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 Dec 22, 2016
30 OSX Apps for a Development Laptop in 2017
View gist:b35f3ed6871b7fb7612e1c66f5bf1a52
Moom
Chrome
Alfred
Nylas N1/Spark
Dropbox
iTerm2
Homebrew
nvalt
Node
1password
View Preferences.sublime-settings
{
"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,
View gist:f3ee171995b156e8f1f34e0efc7370e8
# 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"
View gist:757d0963a7589ca376613e4090ab5eb5
#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 Apr 24, 2016 — forked from pcreux/000_postgresql_fancy_datatypes
Postgresql fancy datatypes with Rails / ActiveRecord. Run it with `rake`!
View 000_postgresql_fancy_datatypes
# Postgresql fancy datatypes!
* array
* hstore (=~ hash)
* json
* jsonb
Philippe Creux - [@pcreux](http://twitter.com/pcreux)
View reimbursement_hook.rb
# config/initializers/reimbursement_hook.rb
Rails.application.config.to_prepare do
Spree::Reimbursement.reimbursement_success_hooks = [
->(reimbursement) { puts reimbursement }
]
end
You can’t perform that action at this time.