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
//! # Some weekend fun: Simple Rust, complex maths and having fun in the terminal.. | |
//! | |
//! Let's start with a quick thought experiment: If you take a number, e.g. 4 and square it, | |
//! (16) and square it again (256) you quickly realize the numbers run towards infinity. This | |
//! is true for all numbers, right? Well, not quite. Everything between -1..1 will converge | |
//! towards 0 rather than infinity. | |
//! | |
//! So for real numbers this is quite boring. However, if we step it up to complex numbers, we | |
//! have a 2D plane and could render a nice chart... | |
//! |
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
// Debug using /usr/bin/log stream --process Phoenix | |
new Key('right', [ 'ctrl', 'cmd' ], function () { | |
try { | |
Phoenix.log("Right") | |
var wnd = Window.focused(); | |
if (!wnd) { | |
return; |
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
// Debug using log stream --process Phoenix | |
new Key('right', [ 'ctrl', 'cmd' ], function () { | |
var wnd = Window.focused(); | |
if (!wnd) { | |
return; | |
} | |
if (!wnd.screen()) { | |
return; |
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
/** | |
* Use with: https://github.com/kasper/phoenix | |
* | |
* I start my apps using F-keys provided by the apple keyboard which are | |
* otherwise rigorously ignored by other applications. | |
* | |
* ^ + CMD + <- and -> move windows from one screen to another | |
* ^ + CMD + UP maximizes the current window | |
* CMD + < cycles through windows of the current application | |
**/ |
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
Watch w = Watch.start(); | |
int msgs = 10_000_000; | |
AtomicInteger received = new AtomicInteger(); | |
for (int i = 0; i < msgs; i++) { | |
Async.defaultExecutor().start(() -> { | |
Async.defaultExecutor().start(() -> { | |
int numReceived = received.incrementAndGet(); | |
if (numReceived % 500_000 == 0) { | |
System.out.println(numReceived + " " + w.duration()); | |
} |
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
# | |
# Made with all the love in the world | |
# by scireum in Remshalden, Germany | |
# | |
# Copyright by scireum GmbH | |
# http://www.scireum.de - info@scireum.de | |
# written by Andreas Haufler (aha@scireum.de) | |
# Licensed under the MIT license: http://opensource.org/licenses/MIT | |
# | |
# X-TOOL provides a very simple tool for invoking frequent commands. |