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 ( $controllerHasModel ) { | |
$model = property_exists($c->{$controllerModel}, $modelName) ? $c->{$controllerModel}->{$modelName} : $c->{$modelName}; | |
if (get_class($model) == 'AppModel') { | |
if (!class_exists($modelName)) { | |
App::import('Model', $modelName); | |
} | |
if (!class_exists($modelName)) { | |
return false; | |
} | |
$model = new $modelName(); |
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
Hello from GitHub Gist Wordpress Plugin! |
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
public TextEditor createHTMLTextEditor() { | |
try { | |
Class cls = Class | |
.forName("org.eclipse.wst.sse.ui.StructuredTextEditor"); | |
for (Constructor constructor : cls.getDeclaredConstructors()) { | |
if (constructor.getGenericParameterTypes().length == 0) { | |
return (TextEditor) constructor.newInstance(new Object[0]); | |
} | |
} | |
} catch (Throwable throwable) { |
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
<dependency> | |
<groupId>HelloWorld</groupId> | |
<artifactId>HelloWorldProxy</artifactId> | |
<version>0.0.1-SNAPSHOT</version> | |
<type>jar</type> | |
<scope>compile</scope> | |
</dependency> |
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
public class SourceEditorFactory { | |
private static IConfigurationElement cachedConfigurationElement; | |
private static final String ATTRIBUTE_CLASS = "class"; | |
public static ITextEditor createSourceEditor() { | |
if (cachedConfigurationElement == null) { | |
cachedConfigurationElement = readConfigurationElement(); | |
} |
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 Baz implements Serializable { | |
private A a; | |
private B b; | |
private C c; | |
... | |
} |
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
ant -Dbuild.compiler=org.eclipse.jdt.core.JDTCompilerAdapter | |
-Dant.build.javac.target=1.6 | |
-Dant.build.javac.source=1.6 compile |
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
- build_config | |
- build.properties |
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 User < ActiveRecord::Base | |
include TablelessColumns | |
tableless_column :license_accepted, :boolean | |
# other fields that are corresponding to table columns | |
end | |
module TablelessColumns | |
def self.included(base) |
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
# Author: Pieter Noordhuis | |
# Description: Simple demo to showcase Redis PubSub with EventMachine | |
# | |
# Update 7 Oct 2010: | |
# - This example does *not* appear to work with Chrome >=6.0. Apparently, | |
# the WebSocket protocol implementation in the cramp gem does not work | |
# well with Chrome's (newer) WebSocket implementation. | |
# | |
# Requirements: | |
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby |
OlderNewer