Skip to content

Instantly share code, notes, and snippets.

View mexiter's full-sized avatar

Merxhan Emini mexiter

View GitHub Profile
<?php
/**
* The admin-specific functionality of the plugin.
*
* @link http://casino.tables.plugin
* @since 1.0.0
*
* @package Casino_Tables_Plugin
* @subpackage Casino_Tables_Plugin/admin
@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 / gulp.js
Created June 26, 2016 12:06
gulp_environments and minifies fron lynda
var gulp = require('gulp'),
gutil = require('gulp-util'),
coffee = require('gulp-coffee'),
browserify = require('gulp-browserify'),
compass = require('gulp-compass'),
connect = require('gulp-connect'),
gulpif = require('gulp-if'),
uglify = require('gulp-uglify'),
minifyHTML = require('gulp-minify-html'),
jsonminify = require('gulp-jsonminify'),
@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-config.php
Created May 20, 2016 22:49
Multiple Environments wp-config
<?php
if( stristr( $_SERVER['SERVER_NAME'], "dev" ) ) {
// Dev Environment
define( 'DB_NAME', 'project_dev' );
define( 'DB_USER', 'project_dev_user' );
define( 'DB_PASSWORD', 'password' );
define( 'DB_HOST', 'localhost' );
@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
background: -moz-linear-gradient(left, rgba(237,237,237,1) 36%, rgba(237,237,237,0.98) 37%, rgba(237,237,237,0) 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(left, rgba(237,237,237,1) 36%,rgba(237,237,237,0.98) 37%,rgba(237,237,237,0) 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to right, rgba(237,237,237,1) 36%,rgba(237,237,237,0.98) 37%,rgba(237,237,237,0) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ededed', endColorstr='#00ededed',GradientType=1 ); /* IE6-9 */