Skip to content

Instantly share code, notes, and snippets.

View litonarefin's full-sized avatar
🎯
Focusing

Liton Arefin litonarefin

🎯
Focusing
View GitHub Profile
@litonarefin
litonarefin / multiple-push-urls.md
Created May 11, 2018 19:15 — forked from bjmiller121/multiple-push-urls.md
Add multiple push URLs to a single git remote

Sometimes you need to keep two upstreams in sync with eachother. For example, you might need to both push to your testing environment and your GitHub repo at the same time. In order to do this simultaneously in one git command, here's a little trick to add multiple push URLs to a single remote.

Once you have a remote set up for one of your upstreams, run these commands with:

git remote set-url --add --push [remote] [original repo URL]
git remote set-url --add --push [remote] [second repo URL]

Once set up, git remote -v should show two (push) URLs and one (fetch) URL. Something like this:

@litonarefin
litonarefin / edd-discounts-subscribers.php
Created June 14, 2018 20:22 — forked from ashleyfae/edd-discounts-subscribers.php
Automatically email a discount code to new ActiveCampapign subscribers.
<?php
/**
* Plugin Name: EDD - Discounts for Subscribers
* Plugin URI: https://www.nosegraze.com/subscribers-edd-discount-code
* Description: Automatically email a discount code to new ActiveCampaign subscribers.
* Version: 1.0
* Author: Nose Graze
* Author URI: https://www.nosegraze.com
* License: GPL2
*
.rsync_cache
.vagrant
*~
Guardfile
*.swp
.idea
.DS_Store?
.DS_Store
ehthumbs.db
Icon?
@litonarefin
litonarefin / Select.js
Created November 27, 2018 07:02 — forked from Shelob9/Select.js
Gutenberg React state example
const { __ } = wp.i18n;
const { Component } = wp.element;
const el = wp.element.createElement;
export default class Select extends Component {
constructor( props ) {
super( ...props );
this.selectCallback = this.selectCallback.bind(this);
this.state = {
<?php
/**
* Custom template tags for this theme.
*
* Eventually, some of the functionality here could be replaced by core features.
*
* @package Elevation
*/
if ( ! function_exists( 'elevation_posted_on' ) ) :
<?php
function elevation_theme_custom_styles(){
global $elevation_options;
global $post_id;
$page_thumbnail_image = wp_get_attachment_url( get_post_thumbnail_id( get_the_ID(), 'full' ) );
switch( $elevation_options['elevation_preset_colors'] ){
case 1:
$elevation_color = "#ff5722";
break;
<?php
/*
* WordPress Breadcrumbs
* author: Dimox
* version: 2019.03.03
* license: MIT
*/
function dimox_breadcrumbs() {
/* === OPTIONS === */
@litonarefin
litonarefin / breadcrumbs-functions.php
Created March 5, 2019 10:42 — forked from tinotriste/breadcrumbs-functions.php
Wordpress: Breadcrumbs function
<?php
/*=============================================
= BREADCRUMBS =
=============================================*/
// to include in functions.php
function the_breadcrumb() {
$sep = ' > ';
'eicon-editor-link' => 'eicon-editor-link',
'eicon-editor-unlink' => 'eicon-editor-unlink',
'eicon-editor-external-link' => 'eicon-editor-external-link',
'eicon-editor-close' => 'eicon-editor-close',
'eicon-editor-list-ol' => 'eicon-editor-list-ol',
'eicon-editor-list-ul' => 'eicon-editor-list-ul',
'eicon-editor-bold' => 'eicon-editor-bold',
'eicon-editor-italic' => 'eicon-editor-italic',
'eicon-editor-underline' => 'eicon-editor-underline',
'eicon-editor-paragraph' => 'eicon-editor-paragraph',
@litonarefin
litonarefin / ecp-widget.php
Created September 11, 2019 13:40 — forked from spigotdesign/ecp-widget.php
Events Calendar Pro event
<?php $efeed = new WP_Query( array(
'post_type' => 'tribe_events',
'showposts' => 2,
'eventDisplay' => 'upcoming',
'start_date' => $current_date,
'end_date' => $current_date,
'orderby' => 'start_date',
'order' => 'ASC',
'tax_query' => array(
array(