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 / wavesurfer-wp-custom-function.js
Last active May 31, 2017 09:27
WaveSurfer-WP JavaScript functions
var $j = jQuery.noConflict();
$j(document).on(' ready wavesurfer-wp-init wavesurfer-markers-init', function() { //
$j.each(wavesurfer, function(i) {
wavesurfer[i].on('ready', function() { // Change the event if you need to
// YOUR FUNCTION
});
});
});
@X-Raym
X-Raym / toc.php
Created May 11, 2017 13:47
Table of Content Plus Case Insensitive
<?php
if ( @preg_match('/^' . $excluded_headings[$j] . '$/imU',
// ==>
if ( @preg_match('/^' . $excluded_headings[$j] . '$/mU',
@X-Raym
X-Raym / Highcharts Cheat Sheet.js
Created June 8, 2017 11:06 — forked from mulhoon/Highcharts Cheat Sheet
Highcharts Cheat Sheet
$('#container').highcharts({
chart: {
alignTicks: true, // When using multiple axis, the ticks of two or more opposite axes will automatically be aligned by adding ticks to the axis or axes with the least ticks.
animation: true, // Set the overall animation for all chart updating. Animation can be disabled throughout the chart by setting it to false here.
backgroundColor: '#FFF', // The background color or gradient for the outer chart area.
borderColor: '#4572A7', // The color of the outer chart border.
borderRadius: 5, // The corner radius of the outer chart border. In export, the radius defaults to 0. Defaults to 5.
borderWidth: 0, // The pixel width of the outer chart border.
className: null, // A CSS class name to apply to the charts container div, allowing unique CSS styling for each chart.
defaultSeriesType: 'line', // Alias of type.
@X-Raym
X-Raym / learndash-users-results-custom.php
Last active August 16, 2021 00:40
LearnDash Users Results - Hooks Usage
<?php
/*
Plugin Name: LearnDash Users Results - Customization
Description: LearnDash Users Results - Customization
Author: X-Raym
Author URI: https://www.extremraym.com/
*/
// Chane user name display
add_filter( 'learndash_users_results_user_display', 'learndash_users_results_user_display', 10, 1 );
@X-Raym
X-Raym / child property from method.js
Created June 28, 2017 11:53
Access JavaScript Object Property from a Method
var obj = function() {
var self = this; // This is the trick
this.data = "4";
this.do = function() {
return self.data; // This is how to use it
}
}
var test = new obj;
@X-Raym
X-Raym / git_functions.md
Last active January 8, 2019 11:47
Common git feature
  • Delete Last Gist Commit

this will delete unsaved changes!

git reset --hard HEAD~1
git push -f origin master
@X-Raym
X-Raym / lua-to-js patterns
Created July 1, 2017 16:03
Lua to JavaScript
--
//
local
var
= {}
= []
==
@X-Raym
X-Raym / reset.css
Created July 20, 2017 10:53
Reset button input form html css style
//https://stackoverflow.com/questions/11053516/css-styling-for-a-button-using-input-type-button-instead-of-button
element {
border:none;
background-image:none;
background-color:transparent;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
@X-Raym
X-Raym / Lua comprison table.lua
Created August 7, 2017 13:42
Lua comparison table
print("Pair comparaison")
array = {true, false, 1, 0, -1,"true","false","1","0","-1","",nil,{},{0},{1} }
for i = 1, 15 do
out = ''
for j = 1, 15 do
if array[i] == array[j] then
out = out .. " " .. "0"
else
first_item_db = -1.8913852603307
last_item_db = -24.660150110898
count_sel_items = 5
db_interval = (last_item_db - first_item_db) / (count_sel_items-1)
for i = 1, count_sel_items do
print(first_item_db + db_interval * (i-1))
end