View gist:34365
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Object | |
def metaclass | |
(class << self; self; end) | |
end | |
end | |
class Foo | |
puts "1. #{self} #{self.__id__}" | |
def meth1 |
View gist:54120
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Implementation of hook_menu(). | |
*/ | |
function whatever_menu() { | |
$items = array(); | |
$items['whatever/somepage'] = array( | |
'title' => 'Whatever', | |
'page callback' => 'drupal_get_form', |
View gist:54122
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get '/whatever/somepage' do | |
'Hello World' | |
end |
View gist:74444
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
View gist:77783
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%%{ | |
machine ruby; | |
alpha_u = alpha | '_'; | |
alnum_u = alnum | '_'; | |
boundary = ^(alnum_u | '.'); | |
newline = '\r'? '\n'; | |
consume_line = any* :>> newline; | |
id = alpha_u (alnum_u)*; |
View gist:77788
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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) |
View constrain.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Copyright (c) 2009 TJ Holowaychuk <tj@vision-media.ca> | |
* MIT Licensed | |
*/ | |
define('GD_CONSTRAIN_DIMENSIONS_VERSION', '0.0.1'); | |
class GD_Constrain_Dimensions { |
View gist:78787
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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."; |
View gist:80770
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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) { |
View gist:81317
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Torque Alternative Syntax | |
unless is_object(FollowMouseBehavior) | |
:template = new BehaviorTemplate(FollowMouseBehavior) | |
:template | |
.friendly_name = "..." | |
.behavior_type = "..." | |
.description = "..." |
OlderNewer