Skip to content

Instantly share code, notes, and snippets.

View iamra's full-sized avatar

Ramael Metatron iamra

View GitHub Profile
@iamra
iamra / .htaccess
Created May 25, 2018 17:12 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@iamra
iamra / gist:03401bb4009ef596631287605518b39e
Created February 15, 2018 22:21 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@iamra
iamra / login.php
Created February 1, 2018 02:25 — forked from paramientos/login.php
#/user/local/vesta/web/login/index.php
`<?php
define('NO_AUTH_REQUIRED',true);
// Main include
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
//echo $_SESSION['request_uri'];
<?php
/*************************************/
session_start();
$digit = "6";
function generate_code($digit) {
$random_it="";
$letters = "abcdefghjkmnprstuxvyz23456789ABCDEFGHJKMNPRSTUXVYZ";
for ($i=0; $i<$digit; $i++) {
$salla .= $letters{rand(0,strlen($letters)-1)};
@iamra
iamra / .gitignore
Last active September 18, 2017 23:02 — forked from salcode/.gitignore
See https://salferrarello.com/wordpress-gitignore/ for the latest version of my WordPress .gitignore file
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20150227
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore
@iamra
iamra / admin-bar-fix.css
Created April 25, 2017 00:39 — forked from AJ-Acevedo/admin-bar-fix.css
WordPress 3.6 and Bootstrap 3 Admin bar overlap fix
// This fixes the WordPress admin-bar 28px overlap issue with Bootstrap 3.
body.admin-bar .navbar {
position:fixed;
top: 28px;
z-index: 1000;
height: 40px;
// If the above does not work try this if your nav is wrapped in .header
@iamra
iamra / wordpress-functionality-plugin.php
Created November 1, 2016 12:56 — forked from rickrduncan/wordpress-functionality-plugin.php
This WordPress functionality plugin contains code snippets that tweak WordPress core and do not contain theme specific functionality. This is code that I run on every single website I build using WordPress.
<?php
/**
* Plugin Name: WordPress Functionality Plugin
* Plugin URI: http://rickrduncan.com/wordpress/functionality-plugin
* Description: Core WordPress customizations that are theme independent.
* Author: Rick R. Duncan - B3Marketing, LLC
* Author URI: http://rickrduncan.com
*
*
* Version: 1.0.0
@iamra
iamra / functions.php
Created September 26, 2016 19:26 — forked from kloon/functions.php
WooCommerce set tax exemption based on user role
<?php
add_filter( 'init', 'wc_tax_exempt_user_roles' );
function wc_tax_exempt_user_roles() {
if ( ! is_admin() ) {
global $woocommerce;
if ( current_user_can('wholesaler') || current_user_can('distributor') ) {
$woocommerce->customer->set_is_vat_exempt(true);
} else {
$woocommerce->customer->set_is_vat_exempt(false);
}
@iamra
iamra / WooCommerce_free_shipping_user_role.php
Created September 14, 2016 18:44 — forked from kloon/WooCommerce_free_shipping_user_role.php
WooCommerce Free Shipping based on user role
<?php
function get_user_role() {
global $current_user;
$user_roles = $current_user->roles;
$user_role = array_shift($user_roles);
return $user_role;
}
<?php
/**
* Disable all sales.
*
* A simple function to disable all the sales in the shop.
* Uncomment the line of code to disable the sale price on products.
*/
function custom_wc_get_sale_price( $sale_price, $product ) {