for easy to use "shadertoy glsl" to "gem glsl" you can use theses examples here :
https://github.com/danomatika/BangYourHead/tree/master/7.Graphics/10.Shaders/2.ShaderToy
basically you have to copy/paste this glsl header code to be compliant with gem :
/////////////////////////start Pd Header
// 2015 Sofy Yuditskaya
// put all the shadertoy constants here for ease of use
uniform vec3      iResolution;           // viewport resolution (in pixels)
uniform float     iGlobalTime;           // shader playback time (in seconds)
uniform float     iTimeDelta;            // render time (in seconds)
uniform int       iFrame;                // shader playback frame
uniform float     iChannelTime[4];       // channel playback time (in seconds)
uniform vec3      iChannelResolution[4]; // channel resolution (in pixels)
uniform vec4      iMouse;                // mouse pixel coords. xy: current (if MLB down), zw: click
// changed samplerXX to sampler2D so it would be recognized, you can also change it to samplerCube as needed
uniform sampler2D iChannel0;          // input channel. XX = 2D/Cube
uniform sampler2D iChannel1;          // input channel. XX = 2D/Cube
uniform sampler2D iChannel2;          // input channel. XX = 2D/Cube
uniform sampler2D iChannel3;          // input channel. XX = 2D/Cube
uniform vec4      iDate;                 // (year, month, day, time in seconds)
uniform float     iSampleRate;           // sound sample rate (i.e., 44100)
void mainImage(out vec4 fragColor, in vec2 fragCoord);
// changelog for Pd:
//running mainImage() from main()
// declared Shadertoy's usual variables above
// declared iChannel0...3 variables individually
void main(  )
{
    mainImage(gl_FragColor, gl_FragCoord.xy);
}
//paste ShaderToy code below
/////////////////////////end Pd Header