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 / ReaScriptLesson03-VolumeConversion.lua
Last active December 7, 2024 08:58
ReaScript Lua Tutorial
---------------- Old Version :
vol_dB = 20 * ( math.log( vol_log, 10 ) )
vol_log = math.exp( vol_dB * 0.115129254 )
---------------- New Version :
-- Mod from SPK77
-- http://forum.cockos.com/showpost.php?p=1608719&postcount=6
@X-Raym
X-Raym / lookahead camera
Last active March 9, 2016 12:43
Construct 2
// by jerementor
// https://www.youtube.com/watch?v=e9Qh4_zsSCo
// First create an empty object called obj_camera
// Then, if event sheet :
Global number cameraSpeed = 0.08
Global number lookAhead = 30
Global number cameraHeight = 10
@X-Raym
X-Raym / RSS providers
Last active August 15, 2017 10:42
Some hidden RSS feed for popular website
https://www.youtube.com/feeds/videos.xml?channel_id=CHANNELID
https://www.youtube.com/feeds/videos.xml?user=USERNAME
https://www.youtube.com/feeds/videos.xml?playlist_id=YOURPLAYLISTIDHERE
http://www.dailymotion.com/rss/user/USERNAME
@X-Raym
X-Raym / hearthis.at oembed.txt
Created March 12, 2016 02:23
hearthis.at omebed
From https://twitter.com/hearthisat/status/685001842246443008
http://hearthis.at/oembed/?url=https://hearthis.at/krissdek/kriss-dek-good-day-original-mix/&format=xml
@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
@X-Raym
X-Raym / omebed-gist
Created March 16, 2016 02:05
Oembed Gist
If specific file and space in file name
https://gist.github.com/X-Raym/f515430e8117e6a87d6f#file-ReaScript%20Lesson%2009%20-%20Preventing%20bugs.lua
spaces : %20
prefix : #file-
extension : file-name.extension
@X-Raym
X-Raym / inspect.php
Created March 17, 2016 10:50
WordPress inspect styles and scripts
<?php
function inspect_scripts() {
if (!is_admin()) {
global $wp_scripts, $wp_styles;
echo '<h1>Scripts</h1>';
echo '<ol>';
foreach( $wp_scripts->queue as $handle ) :
echo '<li>' . $handle . '</li>';
endforeach;
echo '</ol>';
@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 / Multiline text to array.php
Created April 28, 2016 12:26
Multiline text to array
<?php
$text_array = preg_split( "/\r?\n/", $multiline_text ); // Multilines to array
@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