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 / easy-digital-downloads_auto-activate-license-at-purcahse.php
Last active April 28, 2016 14:01
Auto-activate license after a product purchase in WordPress Easy Digital Downloads.
<?php
// Auto Activate EDD License if Custom Field is True -- by X-Raym
function edd_auto_activate_activate_license( $license_id, $download_id, $payment_id ) {
// Only specific download get auto activation (custom field)
if ( ! get_field( 'auto-activate', $download_id ) )
return false;
$store_url = get_site_url(); // Multilingual site friendly
@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 / Lua Local vs Global function simple banchmark.lua
Created July 12, 2016 13:14
Lua Local vs Global function simple banchmark
-- Time function from http://stackoverflow.com/questions/463101/lua-current-time-in-milliseconds
-------------------------------------------------------------
-- TEST A
-- Local Function
local function Add( val )
return val + 1
end
@X-Raym
X-Raym / styles.less
Created July 21, 2016 13:06
Better HTML syntax color for Atom
// Tags
atom-text-editor::shadow .tag.html,
atom-text-editor::shadow .begin.html, atom-text-editor::shadow .end.html {
color: #e06c75;
}
// Inside Tags
atom-text-editor::shadow .meta.tag.any.html,
atom-text-editor::shadow .string.begin.html,
atom-text-editor::shadow .string.end.html {
@X-Raym
X-Raym / Parallelipedic Hole.lua
Created August 19, 2016 18:51
ComputerCraft Edu Scripts
SURFACE
CODE
-- Trous X Y Z for ComputerCraft 1.74 / Minecraft 1.7.10
-- X-Raym, Friops, Hengry
-- 2015-08-25
-- A script to dig a parallepipedic hole x y z.
-- CUSTOMIZATION
longueur = 4
largeur = 6
@X-Raym
X-Raym / .htaccess
Last active September 13, 2016 23:15
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
arts = {'Accent','Staccato','Tenuto','Staccatissimo','Marcato','Fermata'}
index = 10
for i, art in ipairs( arts ) do
output = 'slider' .. index .. ':0<0,2,1{None,CC,Note}>' .. art .. ' Output'
print (output)
index = index + 1
@X-Raym
X-Raym / REAPER actions list template.html
Last active October 15, 2016 14:52
A better export action list template. Still minimal but already more practical. Pure valid semantic HTML 5.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>REAPER actions list</title>
</head>
<body>
@X-Raym
X-Raym / Generate lots of wordpres audio shortcode.lua
Last active October 21, 2016 13:07
Generate lots of wordpres audio shortcodes
array = {
'https://ia802707.us.archive.org/13/items/SouthernTierRadioTheatreProgram9/strt9_64kb.mp3',
'https://archive.org/download/Caruso_part1/Caruso-AddioAllaMadre.mp3',
'https://archive.org/download/Caruso_part1/Caruso-AddioDolceSvegliareAllaMattinawFarrarCiaparelliScotti.mp3',
'https://archive.org/download/Caruso_part1/Caruso-AdorablesTourments.mp3',
'https://archive.org/download/Caruso_part1/Caruso-CantiqueDeNoel.mp3',
'https://archive.org/download/Caruso_part1/Caruso-CelesteAida_2.mp3',
'https://archive.org/download/Caruso_part1/Caruso-CujusAnimann.mp3',
'https://archive.org/download/Caruso_part1/Caruso-DelTempioAlLimitarwMarioAncona.mp3',
'https://archive.org/download/Caruso_part1/Caruso-DellanatalsuaterrailpadreOtucheinsenoaglangeli.mp3',
@X-Raym
X-Raym / learndash blocked user.sql
Created October 29, 2016 14:30
Get learndash blocked users
1."Je veux les lignes pour lequel le quiz_id est égal à 191" :
SELECT *
FROM wp_wp_pro_quiz_lock
WHERE quiz_id = 191
2. "Je veux supprimer la ligne pour lequel le quiz est egal à 91 et l'user_id à 384" :
DELETE