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
ScreenRouter = Backbone.Router.extend( | |
routes: | |
"" : "index" | |
":page": "page" | |
index: -> | |
@.navigate("#scores") | |
page: (page) -> | |
Session.set('currentPage', page) |
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
# expose a list of players | |
Template.scores.players = -> | |
return Objects.find({type: 'player'}, sort: sortOrder()).fetch().slice(0,Session.get('page_size')) | |
# expose a user object | |
Template.profile.user = -> | |
return Objects.findOne({type: 'user'}) | |
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
proc.on('exit', function (code, signal) { | |
if (signal) { | |
log_to_clients({'exit': 'Exited from signal: ' + signal}); | |
} else { | |
log_to_clients({'exit': 'Exited with code: ' + code}); | |
if (code >= 40) process.exit(code - 40); | |
} | |
on_exit_callback(); | |
}); |
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
watcher.watch __dirname + '/../public' | |
watcher.watch __dirname + '/../views' | |
io.sockets.on 'connection', (socket) -> | |
watcher.on 'changed', -> socket.emit 'cmd:refresh' |
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
/* | |
You can now create a spinner using any of the variants below: | |
$("#el").spin(); // Produces default Spinner using the text color of #el. | |
$("#el").spin("small"); // Produces a 'small' Spinner using the text color of #el. | |
$("#el").spin("large", "white"); // Produces a 'large' Spinner in white (or any valid CSS color). | |
$("#el").spin({ ... }); // Produces a Spinner using your custom settings. | |
$("#el").spin(false); // Kills the spinner. |
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
series = _.map instances, (name) => (done) => | |
return done "no node defined with name #{name}" unless configuration.config.nodes[name] | |
configuration.config.nodes[name].name = name; | |
parallel = _.map [0..env.instances[name].qty-1], (i) => (done) => | |
if env.state == "disabled" | |
logger.info "environment disabled, skipping node #{name}" | |
return done() | |
if env.instances[name].state == "disabled" |
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
@ContextConfiguration | |
@SpringBootTest(webEnvironment=SpringBootTest.WebEnvironment.RANDOM_PORT) | |
@ExtendWith(SpringExtension.class) | |
public class WebClientTest { | |
private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(WebClient.class); | |
private static final String BODY = "this is the body"; | |
private static final String ENDPOINT = "endpoint"; | |
@LocalServerPort |
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
@ContextConfiguration | |
@SpringBootTest(webEnvironment=SpringBootTest.WebEnvironment.RANDOM_PORT) | |
@ExtendWith(SpringExtension.class) | |
public class WebClientTest { | |
private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(WebClientTest.class); | |
private static final String BODY = "this is the body"; | |
private static final String ENDPOINT = "endpoint"; | |
private static final StringDecoder stringDecoder = StringDecoder.textPlainOnly(false); |
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
@RestController | |
@SpringBootApplication | |
public class Application { | |
private static final int B_TO_KIB = 1024; | |
private static final int KIB_TO_MIB = 1024; | |
private final String chars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; | |
private final Random r = new Random(); | |
private final Map<Long, Mono<String>> cached = new ConcurrentHashMap<>(); |