Skip to content

Instantly share code, notes, and snippets.

View Uriopass's full-sized avatar

Pâris DOUADY Uriopass

View GitHub Profile
@Uriopass
Uriopass / sort_derive.py
Created November 5, 2020 11:01
Sort derives in Rust code to be consistent
import os
import fileinput
import re
a = re.compile(r"^#\[derive\((\s*[a-zA-Z0-9_]+\s*,)*(\s*[a-zA-Z0-9_]+\s*)\)]$")
special = ["Copy", "Clone", "Default", "Debug", "PartialEq", "Eq", "PartialOrd", "Ord", "Serialize", "Deserialize"]
special = {x: i for i, x in enumerate(special)}
@Uriopass
Uriopass / pub-sub.js
Created March 1, 2021 14:46 — forked from reu/pub-sub.js
node.js redis pub-sub example
var redis = require("redis")
, subscriber = redis.createClient()
, publisher = redis.createClient();
subscriber.on("message", function(channel, message) {
console.log("Message '" + message + "' on channel '" + channel + "' arrived!")
});
subscriber.subscribe("test");
fn main() {
let fs = std::fs::read_to_string("in.txt").unwrap();
let mut sensors = vec![];
for line in fs.lines() {
let mut parts = line.split_whitespace();
let sensor: (i32, i32) = (parts.nth(2).unwrap().trim_matches(|c| c == 'x' || c == '=' || c == ',').parse().unwrap(),
parts.next().unwrap().trim_matches(|c| c == 'y' || c == '=' || c == ':').parse().unwrap());
let beacon: (i32, i32) = (parts.nth(4).unwrap().trim_matches(|c| c == 'x' || c == '=' || c == ',').parse().unwrap(),
parts.nth(0).unwrap().trim_matches(|c| c == 'y' || c == '=' || c == ',').parse().unwrap());
**Privacy Policy**
Pâris DOUADY built the Musidex app as an Open Source app. This SERVICE is provided by Pâris DOUADY at no cost and is intended for use as is.
This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service.
If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy.
The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which are accessible at Musidex unless otherwise defined in this Privacy Policy.
Contributor license agreement (CLA)
1. Preamble
Thank you for your interest in Egregoria by Brownrock Games (the "Company"). In order to clarify the intellectual property license granted with Contributions from any person or entity, the Company must have a Contributor License Agreement ("CLA") on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for your protection as a Contributor as well as the protection of the Company and its users; it does not change your rights to use your own Contributions for any other purpose.
2. General
You accept and agree to the following terms and conditions for Your present and future Contributions submitted to the Company. In return, the Company shall not use Your Contributions in a way that is contrary to the public benefit or inconsistent with its bylaws in effect at the time of the Contribution. Except for the license granted herein to the Company and recipients of software distributed by the Company, You