Skip to content

Instantly share code, notes, and snippets.

View max-sixty's full-sized avatar

Maximilian Roos max-sixty

View GitHub Profile
@brendanzab
brendanzab / gist:d41c3ae485d66c07178749eaeeb9e5f7
Last active July 19, 2023 04:28
My personal list of Rust grievances (September 2021)

September 2022:

This has spread to a far wider audience than I had anticipated - probably my fault for using a title that is in hindsight catnip for link aggregators. I wrote this back in 2021 just as a bunch of personal thoughts of my experiences using Rust over the years (not always well thought through), and don't intend on trying to push them further, outside of personal experiments and projects.

Managing a living language is challenging and difficult work, and I am grateful for all the hard work that the Rust community and contributors put in given the difficult constraints they work within. Many of the things I listed below are not new, and there's been plenty of difficult discussions about many of them over the years, and some are being worked on or postponed, or rejected for various good reasons. For more thoughts, please see my comment below.

My personal list of Rust gr

@pheebcodes
pheebcodes / guide.md
Last active March 29, 2022 13:17
Adding architecture to your M1 Mac terminal with starship

Adding the current architecture to your starship command prompt.

# ~/.config/starship.toml

format = """
$username\
$hostname\
$arch\
$shlvl\
@justanotherdot
justanotherdot / x-compile-test
Last active March 21, 2023 16:59
Attempt to build all cross-compile targets supported by `rustc` and report the time taken.
#!/bin/sh -eu
FILTER="${FILTER:="."}"
TOOLCHAIN_BK="$(rustup toolchain list | rg default | awk '{print $1}')"
TOOLCHAIN_KIND_BK="$(echo "$TOOLCHAIN_BK" | rg -o '^(stable|nightly)')"
if [ "$TOOLCHAIN_KIND_BK" != "stable" ]; then
rustup install stable
rustup default stable
fi
@aluxian
aluxian / git_fzf_key_bindings.fish
Last active December 9, 2023 19:34 — forked from junegunn/functions.sh
Key bindings for git+fzf ported to Fish shell https://junegunn.kr/2016/07/fzf-git/
function __git_fzf_is_in_git_repo
command -s -q git
and git rev-parse HEAD >/dev/null 2>&1
end
function __git_fzf_git_status
__git_fzf_is_in_git_repo; or return
git -c color.status=always status --short | \
fzf -m --ansi --preview 'git diff --color=always HEAD -- {-1} | head -500' | \
cut -c4- | \
@joshbode
joshbode / LICENSE.md
Last active April 5, 2024 14:52
YAML Loader with include constructor (Python 3)

MIT License

Copyright (c) 2018 Josh Bode

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

@apeckham
apeckham / gist:e98a303a9de73b4cf037
Created June 11, 2015 17:44
find broken symlinks on mac os x
#http://unix.stackexchange.com/questions/34248/how-can-i-find-broken-symlinks
find . -type l ! -exec test -e {} \; -print
@mwender
mwender / impbcopy.m
Last active June 1, 2024 01:23
Command line copy an image file to the clipboard in Mac OS X. See first comment for install instructions.
#import <Foundation/Foundation.h>
#import <Cocoa/Cocoa.h>
#import <unistd.h>
BOOL copy_to_clipboard(NSString *path)
{
// http://stackoverflow.com/questions/2681630/how-to-read-png-image-to-nsimage
NSImage * image;
if([path isEqualToString:@"-"])
{
// http://caiustheory.com/read-standard-input-using-objective-c
@pbugnion
pbugnion / ipython_notebook_in_git.md
Last active October 22, 2023 12:25
Keeping IPython notebooks under Git version control

This gist lets you keep IPython notebooks in git repositories. It tells git to ignore prompt numbers and program outputs when checking that a file has changed.

To use the script, follow the instructions given in the script's docstring.

For further details, read this blogpost.

The procedure outlined here is inspired by this answer on Stack Overflow.

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

@tmiller
tmiller / merge
Last active November 14, 2021 11:16
Bash script to merge master into all branches
#!/bin/bash
# Merges the master branch into all other branches
#
# Process:
#
# - Save the name of the current branch
# - If the current branch is not master then checkout master.
# - Pull the latest changes for master from its upstream branch.
# - Loop over each local branch.