Skip to content

Instantly share code, notes, and snippets.

View genedna's full-sized avatar
🦀
Rust !

Quanyi Ma genedna

🦀
Rust !
View GitHub Profile
@genedna
genedna / git-branching-diagram.md
Created November 26, 2021 14:05 — forked from bryanbraun/git-branching-diagram.md
Example Git Branching Diagram

Example Git Branching Diagram

You can use this diagram as a template to create your own git branching diagrams. Here's how:

  1. Create a new diagram with diagrams.net (formerly draw.io)
  2. Go to File > Open From > URL
  3. Insert this url (it points to the xml data below): https://gist.githubusercontent.com/bryanbraun/8c93e154a93a08794291df1fcdce6918/raw/bf563eb36c3623bb9e7e1faae349c5da802f9fed/template-data.xml
  4. Customize as needed for your team.

  • Weekly Agenda (created on a different day, and embedded with /Block Reference)
  • [[Morning Questions]] [[2/24 -- 3/1/2020]]
    • {{[[slider]]}} How many hours of sleep did I get?
    • [[What's one thing top of mind today?]]
    • [[What's the one thing I need to get done today to make progress?]]
  • Agenda
    • {{[[TODO]]}} 2 hours focused time
    • {{[[TODO]]}} Read 30 minutes #goal-learning #habit
  • Health & self-care
  • {{[[TODO]]}} 30 minutes outside #goal-health #habit
@genedna
genedna / playground.rs
Created January 2, 2020 12:04 — forked from anonymous/playground.rs
Shared via Rust Playground
use std::collections::HashMap;
use std::collections::HashSet;
use std::hash::Hash;
use std::fmt::Debug;
#[derive(Debug, Clone)]
struct EdgeIndex<Ix>(Ix);
#[derive(Debug, Clone)]
struct NodeIndex<Ix>(Ix);
# GCC
CFLAGS="-march=native -O2 -pipe"
CXXFLAGS="${CFLAGS}"
CHOST="x86_64-pc-linux-gnu"
CPU_FLAGS_X86="aes avx avx2 fma3 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3"
MAKEOPTS="-j5"
# USE
SUPPORT="pulseaudio btrfs mtp git udisks gvfs png jpg jpeg alsa client icu sudo python consolekit udev"
DESKTOP="X policykit fileroller cairo cups mount curl dbus vim infinality emoji cjk"
@genedna
genedna / indicatif-hyper.rs
Created September 18, 2019 15:51 — forked from clux/indicatif-hyper.rs
indicatif progress bars with hyper 0.10
pub fn http_download_to_path(url: &str, save: &PathBuf) -> Result<()> {
let client = Client::with_connector(HttpsConnector::new(NativeTlsClient::new().unwrap()));
let mut res = client.get(url).send()?;
if res.status != hyper::Ok {
return Err(Error::SomeError)));
}
let use_progress = true;
if use_progress {
use indicatif::{ProgressBar, ProgressStyle};
pub fn copy_with_progress<R: ?Sized, W: ?Sized>(progress: &ProgressBar,
reader: &mut R, writer: &mut W)
-> io::Result<u64>
where R: Read, W: Write
{
let mut buf = [0; 16384];
let mut written = 0;
loop {
let len = match reader.read(&mut buf) {
Ok(0) => return Ok(written),
@genedna
genedna / audit.rules
Created June 5, 2019 11:21 — forked from Neo23x0/audit.rules
Linux Auditd Best Practice Configuration
# IMPORTANT!
# This gist has been transformed into a github repo
# You can find the most recent version there:
# https://github.com/Neo23x0/auditd
# ___ ___ __ __
# / | __ ______/ (_) /_____/ /
# / /| |/ / / / __ / / __/ __ /
# / ___ / /_/ / /_/ / / /_/ /_/ /
# /_/ |_\__,_/\__,_/_/\__/\__,_/
@genedna
genedna / go-redis-pub-sub.go
Created March 8, 2019 10:47
go-redis pub sub example
package main
import (
"github.com/go-redis/redis"
)
var (
RedisClient *redis.Client
)
package main
import (
"fmt"
"sort"
"time"
)
type Master []time.Time
app:
image: bradrydzewski/go:1.2
git:
path: github.com/drone/drone
environment:
- GOROOT=/usr/local/go
- PATH=$PATH:$GOROOT/bin:$GOPATH/bin
services:
- redis
- mysql