Skip to content

Instantly share code, notes, and snippets.

Avatar

Sandro V sandrovicente

View GitHub Profile
@sandrovicente
sandrovicente / playground.rs
Created Sep 29, 2019 — forked from rust-play/playground.rs
Code shared from the Rust Playground
View playground.rs
#![feature(slice_patterns)]
use itertools::Itertools;
use std::collections::HashMap;
#[derive(Debug, PartialEq, Eq, Hash)]
enum Kind { Zero, Five, Other }
fn main() {
@sandrovicente
sandrovicente / future.rs
Last active May 23, 2019 — forked from rust-play/playground.rs
Code shared from the Rust Playground
View future.rs
extern crate futures; // 0.1.26
extern crate tokio; // 0.1.18
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
use std::sync::Arc;
use std::thread::{sleep, spawn};
use std::time::Duration;
use futures::prelude::*;
@sandrovicente
sandrovicente / playground.rs
Last active Feb 4, 2019 — forked from rust-play/playground.rs
another serde + custom datetime serialization
View playground.rs
extern crate chrono;
extern crate serde;
extern crate serde_json;
use serde::{Serialize, Deserialize};
use chrono::{Utc, DateTime}; // 0.4.6
#[derive(Serialize, Deserialize, Debug)]
struct Point {
x: i32,
@sandrovicente
sandrovicente / playground.rs
Last active Feb 4, 2019 — forked from rust-play/playground.rs
Serde with custom datetime
View playground.rs
#[macro_use]
extern crate serde_derive;
extern crate chrono;
extern crate serde;
extern crate serde_json;
use chrono::{DateTime, Utc};
#[derive(Serialize, Deserialize, Debug)]
View 7bitencodeint.elisp
(defun conv (v)
(let (
(base #x80) (ac v) (q) (r))
(while (> ac 0)
(setq q (/ ac base))
(setq r (% ac base))
(if (> q 0) (setq r (+ r base)))
(print (format "%x" r))
(setq ac q))))
@sandrovicente
sandrovicente / remove-dotnet-cli-osx
Created Jul 3, 2016
Steps to uninstall a DotNet CLI version on Mac OS X
View remove-dotnet-cli-osx
# delete the dotnet folder under /usr/local/share/dotnet
1. cd /usr/local/share/dotnet && ls
2. sudo rm -rf dotnet
# delete the dotnet reference file at /etc/paths.d/dotnet
1. cd /etc/paths.d && ls
2. sudo rm dotnet