Skip to content

Instantly share code, notes, and snippets.

View michelve's full-sized avatar
🌏
Rise and Reign

Michel michelve

🌏
Rise and Reign
View GitHub Profile
@michelve
michelve / suhosin_installer.sh
Last active July 27, 2016 14:11
install suhosin 0.9.38
wget https://download.suhosin.org/suhosin-0.9.38.tar.gz
tar -xvf suhosin-0.9.38.tgz
cd suhosin-0.9.38
phpize
./configure
make
make install
sudo rm /etc/php.d/suhosin.ini
@michelve
michelve / js call on page load
Created July 20, 2016 14:09
dial phone number on page load
<?php
$phone_cleaned = do_shortcode('[phone]'); // phone number or var that contains the phone number
$phone_formatted = preg_replace("/[^0-9,.]/", "", $phone_cleaned);
?>
$(document).ready(function() {
function getCookie(name) {
var dc = document.cookie;
var prefix = name + "=";
var begin = dc.indexOf("; " + prefix);
if (begin == -1) {
/**
*
* Gulpfile setup
*
* @since 1.0.0
* @authors Ahmad Awais, @digisavvy, @desaiuditd, @jb510, @dmassiani and @Maxlopez
* @package neat
* @forks _s & some-like-it-neat
*/
// You can also use the .is() method along with an appropriate selector for more advanced matching:
if ( $( "#myDiv" ).is( ".pretty.awesome" ) ) {
$( "#myDiv" ).show();
}
.auto { cursor: auto; }
.default { cursor: default; }
.none { cursor: none; }
.context-menu { cursor: context-menu; }
.help { cursor: help; }
.pointer { cursor: pointer; }
.progress { cursor: progress; }
.wait { cursor: wait; }
.cell { cursor: cell; }
.crosshair { cursor: crosshair; }
@michelve
michelve / index.php
Created February 17, 2016 15:02
PHP json
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>test</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div class="container">
@michelve
michelve / wp-create-user.php
Created February 15, 2016 20:26
wordpress create user
add_action('init', 'add_my_user');
function add_my_user() {
$username = 'username123';
$email = 'drew@example.com';
$password = 'pasword123';
$user_id = username_exists( $username );
if ( !$user_id && email_exists($email) == false ) {
$user_id = wp_create_user( $username, $password, $email );
if( !is_wp_error($user_id) ) {
@michelve
michelve / wp-auto-login.php
Created February 15, 2016 20:22
wordpress auto login
/*
Plugin Name: Auto Login
Plugin URI: http://hbt.io/
Version: 1.0.0
Author: Harri Bell-Thomas
Author URI: http://hbt.io/
*/
function autologin() {
// PARAMETER TO CHECK FOR