Skip to content

Instantly share code, notes, and snippets.

View mexiter's full-sized avatar

Merxhan Emini mexiter

View GitHub Profile
@mexiter
mexiter / nginx.conf
Created November 20, 2018 12:42 — forked from Stanback/nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
@mexiter
mexiter / wp-cli-migrate-db.md
Created March 29, 2018 12:55 — forked from harryfinn/wp-cli-migrate-db.md
WP-CLI DB migrate instructions

Instructions for using WP-CLI to migrate a WordPress DB

# Export current (local) DB
wp db export db.sql

# Copy file from local to server (may need to amend server path if not in html folder)
# The example below is for local to remote, simply swap these 2 around for remote to local
scp -r db.sql www-data@IP_ADDRESS:/var/www/html

# SSH onto box (should be same connection details as above)
(function($){
if (typeof(data) === 'undefined') {
return false;
}
if ( 'chart_most_popular' == data.data_type ) {
var post_titles = [],
post_comment_count = [];
@mexiter
mexiter / acf_slider_bootstrap
Created July 12, 2016 10:28 — forked from webgurus/acf_slider_bootstrap
Root's bootstrap slider example with Advanced Custom Fields Gallery plugin.
<?php
/* SLIDER CUSTOM FIELD FOR HOMEPAGE */
$images = get_field('slider_photos');
$count=0;
$count1=0;
if($images) : ?>
<div id="slider">
<div id="carousel" class="carousel slide">
<!-- Indicators -->
@mexiter
mexiter / gravity_forms_example_1.php
Created June 25, 2016 19:41 — forked from boreal321/gravity_forms_example_1.php
Gravity Forms hook to stop a form from loading
add_filter('gform_pre_render', 'swp_populate_attendee_list');
function swp_populate_attendee_list($form){
$num = swp_get_the_amount();
if ( count( $num ) < 1 ) {
add_filter('gform_get_form_filter', create_function('', "return 'You have not met the condition! Please go to <a href=\"/?page_id=1\">this form.</a>';") );
}
return $form;
@mexiter
mexiter / wp-download.sh
Created May 14, 2016 20:09 — forked from HoundstoothSTL/wp-download.sh
Download Wordpress through terminal and cleanup
#!/bin/bash
#Download the latest copy of WordPress into a directory, grab all the files in the new /wordpress folder
#Put all the files in the current directory, remove the now empty /wordpress directory
#Remove the tarball
#download latest wordpress with wget
wget http://wordpress.org/latest.tar.gz
#OR using CURL