Skip to content

Instantly share code, notes, and snippets.

-- Quake like console on top
-- Similar to:
-- http://git.sysphere.org/awesome-configs/tree/scratch/drop.lua
-- But uses a different implementation. The main difference is that we
-- are able to detect the Quake console from its name
-- (QuakeConsoleNeedsUniqueName by default).
-- Use:

Keybase proof

I hereby claim:

  • I am vinipsmaker on github.
  • I am vinipsmaker (https://keybase.io/vinipsmaker) on keybase.
  • I have a public key whose fingerprint is 38BF 6E03 FEC7 631C 6DC9 8EB2 4AA9 A15A 3531 4E6B

To claim this, I am signing this object:

#!/usr/bin/env python3
from io import StringIO
import requests
from lxml import etree
from urllib.parse import urlparse, urlunparse, urlencode, parse_qsl
f = requests.request('GET', 'http://rpg-design-patterns.speedykitty.com/doku.php/start?do=index')
#disabled
#do not touch the header of this file
[Unit]
Description=Disable thermal shutdown
[Service]
ExecStart=/usr/bin/dd "if=/etc/systemd/system/%n" skip=1 ibs=1 count=9 of=/sys/class/thermal/thermal_zone0/mode
[Install]
WantedBy=multi-user.target
#include<stdio.h>
int main()
{
int i, n;
scanf("%d", &n);
for (i = 0;i < n;++i) {
printf("c89\n");
}
}

Comparison of coroutine libraries for Rust

NOTE: I didn't find any project with a good enough documentation. A "good enough" documentation would be more explicit about ownership of CPU share, controls and resources (e.g. how do multiple coroutines share the same thread? How do I migrate one coroutine to another thread?).

monkeys is a coroutine crate based on the async/await functions.

fn main() {
for i in 1..100 {
match (i % 3, i % 5) {
(0, 0) => println!("FizzBuzz"),
(0, _) => println!("Fizz"),
(_, 0) => println!("Buzz"),
_ => println!("{}", i)
}
}
}
match network_rx.receive() {
Ok(CrustMsg::Message(msg)) => {
if let Err(err) = event_tx.send(Event::NewMessage(their_id, msg)) {
error!("Error sending message to {:?}: {:?}", their_id, err);
break;
}
}
Ok(m) => error!("Unexpected message in start_rx: {:?}", m),
Err(err) => {
error!("Error receiving from {:?}: {:?}", their_id, err);
ubuntu @ wily64 ~/Projetos/routing $ rm target/debug/examples/*.log; RUST_LOG=routing=info,ci_test=info,crust=trace cargo run --example ci_test
Running `target/debug/examples/ci_test`
--------- Starting 20 nodes -----------
Started Node #1 with Process ID 5107
Started Node #2 with Process ID 5119
Started Node #3 with Process ID 5142
Started Node #4 with Process ID 5176
Started Node #5 with Process ID 5219
Started Node #6 with Process ID 5273
Started Node #7 with Process ID 5336
ubuntu @ wily64 ~/Projetos/routing $ rm target/debug/examples/*.log; RUST_LOG=routing=info,ci_test=info,crust=trace cargo run --example ci_test
Downloading time v0.1.35
Downloading memchr v0.1.11
Downloading fs2 v0.2.4
Downloading mempool v0.3.0
Downloading itertools v0.4.12
Downloading regex v0.1.62
Downloading log v0.3.6
Compiling itertools v0.4.12
Compiling log v0.3.6