Skip to content

Instantly share code, notes, and snippets.

ViewPort.when(Resolution.ALL_MOBILE, Resolution.LAPTOP)
// match // fallback
.then((portChange) -> GWT.log(portChange.getResolution()), (width, height) -> GWT.log("fallback for " + width + " " + height));
ViewPort.when(Resolution.ALL_MOBILE, Resolution.LAPTOP)
// match
.then((portChange) -> GWT.log(portChange.getResolution()));
ViewPort.when(Resolution.ALL_MOBILE)
.or(Resolution.LAPTOP)
public class PasswordResetPage ... implements HasParameters<PasswordResetPage.Params> {
...
public class Params extends PageParams {
public Params(String emailAddress) {
emailAddress(emailAddress);
}
public Params emailAddress(int emailAddress) {
import errai.prototype.client.constants.EditMode;
import errai.prototype.core.client.page.PageParam;
import errai.prototype.core.client.page.PageParams;
public class ModelEditParams extends PageParams {
public PageParam<Integer> id;
public ModelEditParams(int id) {
id(id);
}
public HandlerRegistration addClickHandler(final ClickHandler handler) {
return addHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
if(isEnabled()) {
handler.onClick(event);
}
}
});
}
local totalDamageOut, totalDamageIn, totalHealing = 0.1, 0.1, 0.1 -- avoid dividing by zero
local scores = {}
local info = globalBosses[bossId]
local damageMap = creature:getDamageMap()
for guid, stats in pairs(info) do
local player = Player(stats.playerId)
local part = damageMap[stats.playerId]
local damageOut, damageIn, healing = (stats.damageOut or 0) + (part and part.total or 0), stats.damageIn or 0, stats.healing or 0
local lootFactor = 1
lootFactor = lootFactor / participants ^ (1 / 3) -- tone down the loot a notch if there are many participants
lootFactor = lootFactor * (1 + lootFactor) ^ (con.score / expectedScore) -- increase the loot multiplicatively by how many times the player surpassed the expected score
playerLoot = monsterType:getBossReward(lootFactor, _ == 1)
package gwt.material.design.client.ui;
/*
* #%L
* GwtMaterial
* %%
* Copyright (C) 2015 GwtMaterialDesign
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@BenDol
BenDol / 0_reuse_code.js
Created October 4, 2015 21:59
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@MappedSuperclass
public abstract class BaseSetting extends Model {
@NotNull
@Size(min = 5)
String name;
@Basic
String description;
@Observable(inherit = true)
@Entity(name = "settings")
@Cache(usage=CacheConcurrencyStrategy.TRANSACTIONAL)
public class Setting extends BaseSetting {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
protected int id = Model.UNSAVED_ID;
@Column(columnDefinition="VARCHAR")