Skip to content

Instantly share code, notes, and snippets.

View sandrovicente's full-sized avatar

Sandro V sandrovicente

View GitHub Profile
@sandrovicente
sandrovicente / 7bitencodeint.elisp
Created May 22, 2018 09:40
emacs 7BitEncodedInt
(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 / playground.rs
Last active February 4, 2019 15:51 — forked from rust-play/playground.rs
Serde with custom datetime
#[macro_use]
extern crate serde_derive;
extern crate chrono;
extern crate serde;
extern crate serde_json;
use chrono::{DateTime, Utc};
#[derive(Serialize, Deserialize, Debug)]
@sandrovicente
sandrovicente / playground.rs
Last active February 4, 2019 15:52 — forked from rust-play/playground.rs
another serde + custom datetime serialization
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 / future.rs
Last active May 23, 2019 13:31 — forked from rust-play/playground.rs
Code shared from the Rust Playground
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
Created September 29, 2019 22:22 — forked from rust-play/playground.rs
Code shared from the Rust Playground
#![feature(slice_patterns)]
use itertools::Itertools;
use std::collections::HashMap;
#[derive(Debug, PartialEq, Eq, Hash)]
enum Kind { Zero, Five, Other }
fn main() {
@sandrovicente
sandrovicente / remove-dotnet-cli-osx
Created July 3, 2016 21:37
Steps to uninstall a DotNet CLI version on Mac OS X
# 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