Skip to content

Instantly share code, notes, and snippets.

public static void main(Strnig [] args) {
System.out.println("testing embedding");
}
<example>
<gist-embed-testing with="medium.com">
</gist-embed-testing>
</example>
@gabor-farkas
gabor-farkas / gist:9c06b63cc80e1c0218dd
Created December 4, 2014 13:51
JSF binding example
<h:inputText value="#{personBacking.person.name}"/>
<h:commandButton action="#{personBacking.savePerson}"/>
@gabor-farkas
gabor-farkas / gist:445af5c589c0334f7b41
Created December 4, 2014 13:53
Angular binding example
<input type="text" ng-model="person.name" placeholder="Enter a name here">
<a href="" ng-click="savePerson">Save</a>
@gabor-farkas
gabor-farkas / gist:1249b72f9fa3f04f7915
Created December 4, 2014 14:02
Ds-bean observable property listener example
Person person = new Person();
Person_._name.addValueChangeListener(person, new ValueChangeListener<String>() {
public void changed(String newValue) {
System.out.println("Value changed to: " + newValue);
}
});
person.setName("new name"); // value changed to: new name
@gabor-farkas
gabor-farkas / gist:889f7f1dd1dc6d1caffa
Created December 4, 2014 14:04
Example binding building
Bindings.obs(person).get(Person_._manager).get(Person_._name);
@gabor-farkas
gabor-farkas / gist:d59a83c2bdfe60637bf3
Created March 16, 2015 11:11
STJS variable access question
public static <T> T find(Array<T> inArray, Function1<T, Boolean> predicate) {
class X {
public T result;
public X run() {
inArray.forEach((T item) -> {
if (predicate.$invoke(item)) {
result = item;
}
});
return this;
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="256" height="256">
<defs>
<filter id="filter_ok">
<feColorMatrix type="matrix" values="0 0 0 0 1
0 0 0 0 0
0 0 0 0 0
-1 0 0 1 0"></feColorMatrix>
</filter>
Authenticator.setDefault(new Authenticator() {
public PasswordAuthentication getPasswordAuthentication () {
return new PasswordAuthentication ("DOMAIN\\your.username", "password".toCharArray());
}
});
@ViewScoped
@ManagedBean(name="TestView")
public class TestView extends AbstractBackingView<TestBacking> {
public TestView() {
super(TestBacking.class, "TestBacking", "test");
JsfForm form = new JsfForm("mainform").appendTo(container);
new JsfLabel("headerLabel", "Component showcase")
.withStyleClasses("heading").appendTo(form);
new JsfInputText("messageInput")