Skip to content

Instantly share code, notes, and snippets.

View njlr's full-sized avatar
🌏
F# ing

njlr njlr

🌏
F# ing
View GitHub Profile
#include <iostream>
int main() {
 std::cout << "\e[31m" << "Hello" << "\e[0m" << World" << std::endl;
 return 0;
}
unsigned const terminalWidth = 80;
int main() {
VirtualTerminal vt;
auto const fancyCounter = [](auto start, auto end, auto i) -> FlowLayout<> {
  return {
  Text("counting from "), Text({ Font::Bold }, start), 
  Text(" to "), Text({ Font::Bold }, end),
  Text(": i="), Text({ FgColor::Red, Font::Underline }, i) 
counting from 1 to 10: i=1 [#_________]
counting from 1 to 10: i=2 [##________]
counting from 1 to 10: i=3 [###_______]
counting from 1 to 10: i=4 [####______]
counting from 1 to 10: i=5 [#####_____]
// Pseudo-code
function updateProgressBar() {
 print (eraseCharEscapeCode * lastProgressBarLength);
 print (‘#’ * progressBarLength);
lastProgressBarLength = progressBarLength;
}
curl http://www.openss7.org/repos/tarballs/strx25-0.9.2.1.tar.bz2 > /dev/null
auto progressbar = rx::observable<>::from(
rxcpp::interval(std::chrono::milliseconds(250))
.take_until([](auto x) { return x > 100; })
.map([](auto x) { return x / 100.0;})
.map(Progressbar);
auto app = rx::observable<>::zipWith(
rx::observable<>::just<Text>("progressbar example"),
progressbar,
stackLayout);
buckaroo install boost/asio
A requires B
A requires C
B requires D
C requires D
A v1
B v1
C v2
A v1 requires B v1
A v1 requires C v2
B v1 requires C v1–3