Skip to content

Instantly share code, notes, and snippets.



View GitHub Profile
apiraino /
Last active Apr 10, 2020 — forked from reallistic/
Websocket client for (SockJS)
# Run with
# $ locust -H ws-server:port -P 8080 -f
# then open the browser on localhost:8080
# requirements.txt
# locust==0.0
# locustio==0.14.5
# websocket==0.2.1
import time
View gist:3d10444cbc2f0a529972a13fb2d6a60c
<title>Cargo Build Timings — open-taffeta 0.4.1</title>
<meta charset="utf-8">
<style type="text/css">
html {
font-family: sans-serif;
apiraino / AuthService.php
Last active Mar 31, 2020
Simple static token authentication with Directus API
View AuthService.php
use Directus\Services\AuthService as DirectusAuthService;
use Directus\Authentication\Exception\UserNotFoundException;
class AuthService
private function getToken($req)
apiraino / Dockerfile
Created Jan 27, 2020
Dockerfile test to build all Sway things
View Dockerfile
FROM ubuntu:19.10
MAINTAINER apiraino ""
# Instructions
# docker build -t "swaywm:builder" .
# docker run --rm -v /tmp/sway-compiled:/export -it "swaywm:builder" bash
# then inside the container run "cp -r sway-src/* /export"
# You'll find the build outside the container in "/tmp/sway-compiled"
apiraino / gist:f7ac1852c230b6de9b76171520d29dc4
Last active Sep 8, 2019
Hide Explore Repositories on Github
View gist:f7ac1852c230b6de9b76171520d29dc4
// ==UserScript==
// @name Hide side columns on Github
// @namespace
// @version 0.1
// @description Hide side columns on Github
// @author apiraino
// @match
// @grant none
// @run-at document-start
// @inject-into content
apiraino / config.yml
Last active Aug 17, 2019
Rust stable CircleCI config file (with sccache + rustfmt + clippy)
View config.yml
version: 2.1
- run:
name: Apt get stuff
command: |
# for codecov
# sudo apt install -y libcurl4-openssl-dev libelf-dev libdw-dev cmake gcc binutils-dev libiberty-dev
sudo apt install memcached -y
apiraino /
Last active May 26, 2019
CKB testnet first run

Testing CKB testnet

Following these install instructions (very well detailed!)

Trying the precompiled binaries

SSL 1.1.x not supported therefore Ubuntu 19.04 cannot run the precompiled binaries: will file an issue.

Can't easily install an obsolete OpenSSL version on Ubuntu 19.04

View gist:505a485bd6ac4536279d2f528245284d
fn delay_future() -> Box<Future<Item = (), Error = io::Error> + Send> {
let wait_time = Duration::from_millis(100);
let now = Instant::now();
let task = Interval::new(now, wait_time)
.map_err(|e| panic!("interval errored; err={:?}", e))
.for_each(|instant| {
println!("fire; instant={:?}", instant);
View cargo check false positive
pub struct MyStruct {
num: i32
impl MyStruct {
// setting to "pub", makes the warning disappear
fn new() -> MyStruct {
MyStruct { num : 2 }
You can’t perform that action at this time.