Skip to content

Instantly share code, notes, and snippets.

View CosineP's full-sized avatar

Luna P-C CosineP

View GitHub Profile
@CosineP
CosineP / main.rs
Created April 16, 2019 08:54
laminar reliable packet loss
extern crate laminar;
use std::thread;
use laminar::{Socket, Packet, SocketEvent};
fn main() {
// create the socket
let server = thread::spawn(move || {
let (mut socket, _, packet_receiver) = Socket::bind("127.0.0.1:12346").unwrap();
@CosineP
CosineP / main.rs
Last active April 16, 2019 08:35
amethyst_network reliable packet loss
extern crate amethyst;
use amethyst::{
prelude::*,
ecs::prelude::*,
network::*,
};
fn main() -> amethyst::Result<()> {
let server = gen_game(true);
@CosineP
CosineP / test_pickle.py
Created November 29, 2018 21:29
pickling memory works appropriately, keeping references in-tact
# pickling memory works appropriately, keeping references in-tact
import pickle
heap = ['original']
to_pickle = {'one': heap, 'two': heap}
s = pickle.dumps(to_pickle)
from_pickle = pickle.loads(s)
from_pickle['one'][0] = 'changed'
@CosineP
CosineP / stdout
Created October 4, 2018 06:55
rustc full command from cargo -v
process didn't exit successfully: `rustc --crate-name isolang /home/luna/.cargo/registry/src/github.com-1ecc6299db9ec823/isolang-0.2.1/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="serde"' --cfg 'feature="serde_serialize"' -C metadata=35b6b322fa2f06bd -C extra-filename=-35b6b322fa2f06bd --out-dir /home/luna/madlibs/target/debug/deps -L dependency=/home/luna/madlibs/target/debug/deps --extern phf=/home/luna/madlibs/target/debug/deps/libphf-3c7d5ba6b3e24e50.rlib --extern serde=/home/luna/madlibs/target/debug/deps/libserde-22347f0e065c6006.rlib --cap-lints allow` (signal: 9, SIGKILL: kill)
@CosineP
CosineP / followings.py
Last active September 9, 2018 03:16 — forked from 0xa/followings.py
Mastodon followings management - fork details: old one broke with API changes; add cull followers with --followers
#!/usr/bin/env python3
"""
A script that go through your followings and unfollows dead accounts.
It notices empty accounts, accounts that were deleted locally and remotely,
and also cleans up dead instances if allowed to.
It has a cache so you can run it once without --unfollow to preview its
actions, and a second time that will skip all verified active profiles.
With colors and a nice progress bar with item count, %, and ETA.
@CosineP
CosineP / log
Created August 8, 2018 22:07
mmmmm-mobile build log demonstrating error
~/src/mmmmm-clean master ✔
▶ nvm version
v8.9.4
~/src/mmmmm-clean master ✔
▶ npm --version
5.6.0
~/src/mmmmm-clean master ✔
▶ npm i
> mmmmm@0.0.16-alpha build-android-debug /hdd/documents/src/mmmmm-mobile
> npm run build-android-assets && react-native run-android
> mmmmm@0.0.16-alpha build-android-assets /hdd/documents/src/mmmmm-mobile
> npm run lib && npm run propagate-replacements && npm run build-nodejs-app && npm run build-worker-android
> mmmmm@0.0.16-alpha lib /hdd/documents/src/mmmmm-mobile
@CosineP
CosineP / main.cpp
Created July 14, 2018 21:45
A failing mumlib / portaudio program
#include "mumlib.hpp"
#include "portaudio.h"
#include <thread>
#define SAMPLE_RATE (8000)
#define print printf
mumlib::Mumlib *mumble;
int staticCallback(const void *inputBuffer, void *outputBuffer,
unsigned long framesPerBuffer,
#!python
import os
target = ARGUMENTS.get("target", "debug")
platform = ARGUMENTS.get("platform", "windows")
bits = ARGUMENTS.get("bits", 64)
final_lib_path = 'bin/'
# This makes sure to keep the session environment variables on windows,
@CosineP
CosineP / lunaphippscostin.com-dns.txt
Created May 3, 2018 23:09
lunaphippscostin.com DNS records
FORMAT:
TYPE
HOST
VALUE
A Record
*
216.239.32.21
A Record