Skip to content

Instantly share code, notes, and snippets.

class Object
def metaclass
(class << self; self; end)
end
end
class Foo
puts "1. #{self} #{self.__id__}"
def meth1
/**
* Implementation of hook_menu().
*/
function whatever_menu() {
$items = array();
$items['whatever/somepage'] = array(
'title' => 'Whatever',
'page callback' => 'drupal_get_form',
get '/whatever/somepage' do
'Hello World'
end
if (!isObject(FollowMouseExBehavior))
{
%template = new BehaviorTemplate(FollowMouseExBehavior);
%template.friendlyName = "Follow Mouse Ex";
%template.behaviorType = "Input";
%template.description = "Set the object to follow the position of the mouse. This version can be " @
"restricted by world limits and will obey collisions.";
%template.addBehaviorField(flipX, "Flip X axis", bool, true);
%%{
machine ruby;
alpha_u = alpha | '_';
alnum_u = alnum | '_';
boundary = ^(alnum_u | '.');
newline = '\r'? '\n';
consume_line = any* :>> newline;
id = alpha_u (alnum_u)*;
#line 1 "ext/ruby.rl"
#include <stdio.h>
#include <string.h>
#include "ruby.h"
#include "lightr.h"
// TODO: EOF for consume_line
// TODO: #{ interpolation
// TODO: heredocs ( mirroring of identifier as well)
<?php
/**
* Copyright (c) 2009 TJ Holowaychuk <tj@vision-media.ca>
* MIT Licensed
*/
define('GD_CONSTRAIN_DIMENSIONS_VERSION', '0.0.1');
class GD_Constrain_Dimensions {
# Torque Script
if (!isObject(FollowMouseExBehavior))
{
%template = new BehaviorTemplate(FollowMouseExBehavior);
%template.friendlyName = "Follow Mouse Ex";
%template.behaviorType = "AI";
%template.description = "Set the object to follow the position of the mouse. This version can be " @
"restricted by world limits and will obey collisions.";
/**
* Create a range string which can be evaluated to a native array.
*
* @param {int} start
* @param {int} end
* @return {string}
* @api public
*/
function range(start, end) {
# Torque Alternative Syntax
unless is_object(FollowMouseBehavior)
:template = new BehaviorTemplate(FollowMouseBehavior)
:template
.friendly_name = "..."
.behavior_type = "..."
.description = "..."