Skip to content

Instantly share code, notes, and snippets.

View therustmonk's full-sized avatar
🦀
thread 'main' panicked at 'not yet implemented', src/main.rs:2:5

Denis Kolodin therustmonk

🦀
thread 'main' panicked at 'not yet implemented', src/main.rs:2:5
View GitHub Profile
@therustmonk
therustmonk / github-sponsors-graphql.graphql
Created April 26, 2021 18:01 — forked from claudiodekker/github-sponsors-graphql.graphql
Retrieve a list of sponsors from the Github Graph API
query ($owner: String!, $after: String) {
user (login: $owner) {
sponsorshipsAsMaintainer(first: 100, after: $after, includePrivate: true) {
totalCount
nodes {
sponsorEntity {
... on User {
login
}
}
@therustmonk
therustmonk / vectorize.rs
Created March 12, 2021 13:09
Rust Vectorize: (hashmap, btreemap, complex tuple struct key serialization)
pub mod vectorize {
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use std::iter::FromIterator;
pub fn serialize<'a, T, K, V, S>(target: T, ser: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
T: IntoIterator<Item = (&'a K, &'a V)>,
K: Serialize + 'a,
V: Serialize + 'a,
@therustmonk
therustmonk / serde_patch.rs
Created March 11, 2021 07:18
Serialize maps (HashMap, BTreeMap) with complex keys (tuples, etc) [Rust]
#[derive(Serialize, Deserialize, Debug, Clone, Default, PartialEq, Eq)]
struct Attributes {
#[serde(with = "attr")]
pub attr: HashMap<Request, u32>,
}
mod attr {
use serde::{Deserializer, Serializer};
type Attr = std::collections::HashMap<super::Request, u32>;
@therustmonk
therustmonk / multiple_ssh_setting.md
Created October 22, 2020 21:38 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
  1. Add the RPMFusion repositories (both free and non-free) to the YUM repository directory (/etc/yum.repos.d/):
sudo dnf localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
  1. Install the patched version of FreeType with subpixel rendering enabled:
sudo dnf install -y freetype-freeworld

CSS Grid Admin Dashboard

A dashboard-style admin interface built using CSS Grid, with a Flexbox fallback for older browsers.

A Pen by Max Böck on CodePen.

License.

@therustmonk
therustmonk / playground.rs
Created September 4, 2019 05:07 — forked from rust-play/playground.rs
Code shared from the Rust Playground
use std::marker::PhantomData;
use std::convert::TryInto;
use std::sync::Arc;
use std::ops::Deref;
use std::sync::mpsc::channel;
#[derive(Debug)]
struct MsgOne {
}
### Keybase proof
I hereby claim:
* I am deniskolodin on github.
* I am deniskolodin (https://keybase.io/deniskolodin) on keybase.
* I have a public key ASBGGYDyh9Rv7Ju5uQPNrnFoVm4H4odA8bhHwDhN_HzGNwo
To claim this, I am signing this object:
@therustmonk
therustmonk / playground.rs
Created March 25, 2019 06:59 — forked from rust-play/playground.rs
Code shared from the Rust Playground
#![feature(unboxed_closures)]
#![feature(fn_traits)]
use std::collections::BTreeMap;
struct IncIdGen(i32);
impl FnOnce<()> for &mut IncIdGen {
type Output = i32;
extern "rust-call" fn call_once(self, _args: ()) -> Self::Output {
self.0 += 1;
@therustmonk
therustmonk / create-efi-keys.sh
Last active June 1, 2018 11:44 — forked from Era-Dorta/create-efi-keys.sh
Sign Intel SGX kernel modules on Fedora (UEFI Secure Boot)
# VERY IMPORTANT! After each kernel update or dkms rebuild the modules must be signed again with the script
# ~/.ssl/sign-all-modules.sh
# Place all files in ~/.ssl folder
mkdir ~/.ssl
cd ~/.ssl
# Generate custom keys with openssl
openssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -out MOK.der -nodes -subj "/CN=Owner/"