Skip to content

Instantly share code, notes, and snippets.

View X-Raym's full-sized avatar

Raymond Radet X-Raym

View GitHub Profile
@X-Raym
X-Raym / custom_badgeos_award_popup.php
Last active October 2, 2017 08:23
An add-on for Badgeos to display a pop-up when a user earn an achievement.
<?php
/* STEP 1 : DISPLAY A SIMPLE MODAL WINDOW JAVASCRIPT ALERT WHEN AN ACHIEVEMENT IS EARNED */
// Function for in wp_head : the javascript alert
function custom_badgeos_java_alert() {
$output='<script> alert("Bravo ! tu as gagné un badge !"); </script>';
echo $output;
@X-Raym
X-Raym / site-specific.php
Last active January 16, 2018 01:50
Site Specific WordPress Plugin Code Snippets
<?php
/*
Plugin Name: Site Plugin
Description: Site specific code
Author: X-Raym
Author URI: http://extremraym.com/
*/
/* Enable PHP in widgets */
<!-->pProQuiz_View_StatisticsAjax.php
At line 39, replace
<a href="#" class="user_statistic" data-ref_id="<?php echo $model->getStatisticRefId(); ?>"><?php echo $model->getUserName(); ?></a></code>
by-->
<a href="#" class="user_statistic" data-ref_id="<?php echo $model->getStatisticRefId(); ?>">
<?php
$user_id = $model->getUserId();
$user_info = get_userdata($user_id);
$username = $user_info->user_login;
$first_name = $user_info->first_name;
@X-Raym
X-Raym / EDD-downloadCount-shortcodes.php
Last active May 30, 2016 21:07
Easy Digital Downloads - Downloads Count Shortcode
<?php
// Optional attributs supported : id, offset
function edd_download_count_shortcode( $atts ) {
$post_id = get_the_ID();
$a = shortcode_atts( array(
'offset' => 0,
'id' => $post_id,
), $atts );
@X-Raym
X-Raym / wordpress-popular-post-admin-columns.php
Last active November 20, 2015 16:52
Add Total Views column on Admin list posts pages
<?php
/**
* Add Total Views column on Admin list posts pages
*/
add_action( 'admin_init', 'hook_wpp_views_posts_column', 10 );
function hook_wpp_views_posts_column() {
$post_types = get_post_types( array( 'public' => true ) );
@X-Raym
X-Raym / atom highlight character.less
Last active November 22, 2015 18:55
atom matches bracket highlight character
// From https://discuss.atom.io/t/where-to-set-the-matched-brace-color/12372/17
// by smlombardi
// Puth this in default Less stylesheet
atom-text-editor::shadow .bracket-matcher .region {
border: 1px solid rgba(222, 149, 54, 0.6);
border-radius: 3px;
background-color: rgba(255, 217, 0, 0.3);
z-index: 100;
}
NOTEPAD QUICK FIND REPLACE BEFORE AND AFTER AT END OF LINE
(.+)$
sfwd-courses
sfwd-lessons
sfwd-quiz
sfwd-topic
@X-Raym
X-Raym / horizontal_wiimote_to_vJoy.py
Last active March 1, 2016 22:12 — forked from AVapps/horizontal_wiimote_to_vJoy.py
FreePIE script to use up tu 4 wiimotes and nunchucks with vJoy. Configure your virtual joysticks with x and y axis, 1 "4 directions" POV and 9 buttons.
"""
Horizontal Wiimote to vJoy FreePIE script
Maps up to 4 wiimotes to 4 virtual joysticks using vJoy.
Before running this script define 4 virtual joysticks with x and y axis, 13 buttons (or keep your wiimote + nunchuck virtual joysticks configuration).
version: 1.1
author: Jahdrien
mod: X-Raym
gist: https://gist.github.com/X-Raym/caada7ebc4b76fb01dcd
@X-Raym
X-Raym / Ninja Form - Contact
Created March 2, 2016 03:13
Template for WordPress Ninja Form Plugin, for a simple contact form.
a:4:{s:4:"data";a:13:{s:12:"date_updated";s:19:"2016-02-10 14:31:38";s:14:"clear_complete";s:1:"1";s:13:"hide_complete";s:1:"1";s:10:"show_title";s:1:"0";s:6:"status";s:0:"";s:10:"form_title";s:7:"Contact";s:11:"append_page";s:0:"";s:4:"ajax";s:1:"1";s:9:"logged_in";s:1:"0";s:17:"not_logged_in_msg";s:0:"";s:16:"sub_limit_number";s:0:"";s:13:"sub_limit_msg";s:0:"";s:8:"last_sub";s:1:"1";}s:2:"id";N;s:5:"field";a:9:{i:0;a:7:{s:2:"id";s:2:"12";s:7:"form_id";s:1:"6";s:4:"type";s:11:"g_recaptcha";s:5:"order";s:1:"0";s:4:"data";a:7:{s:5:"label";s:9:"Anti-Spam";s:15:"input_limit_msg";s:17:"character(s) left";s:3:"req";s:1:"1";s:9:"label_pos";s:5:"above";s:9:"show_desc";s:1:"0";s:8:"desc_pos";s:11:"after_label";s:9:"desc_text";s:23:"Click on the box below.";}s:6:"fav_id";N;s:6:"def_id";N;}i:1;a:7:{s:2:"id";s:2:"18";s:7:"form_id";s:1:"6";s:4:"type";s:7:"_hidden";s:5:"order";s:1:"0";s:4:"data";a:13:{s:5:"label";s:9:"User Name";s:15:"input_limit_msg";s:17:"character(s) left";s:18:"default_value_type";s:18:"_user_display