This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Configuration files for Manjaro i3 on Lenovo Yoga 2 pro | |
# to scale properly on HiDPI (3200x1800) | |
# | |
##################################################### | |
~/.profile # | |
##################################################### | |
# UI element scaling, icons | |
export GDK_SCALE=2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::convert::TryFrom; | |
use std::io::{stdin, BufRead}; | |
use std::process::exit; | |
use regex::{Captures, Regex}; | |
fn main() { | |
let re = Regex::new(r"'\\u\{([0-9A-Fa-f]+)\}'").unwrap(); | |
let stdin = stdin(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim | |
index 94cf8d0..4e58385 100644 | |
--- a/autoload/fugitive.vim | |
+++ b/autoload/fugitive.vim | |
@@ -2147,7 +2147,7 @@ function! fugitive#BufReadCmd(...) abort | |
if b:fugitive_display_format | |
call s:ReplaceCmd([dir, 'cat-file', b:fugitive_type, rev]) | |
else | |
- call s:ReplaceCmd([dir, '-c', 'diff.noprefix=false', 'show', '--no-color', '-m', '--first-parent', '--pretty=format:tree%x20%T%nparent%x20%P%nauthor%x20%an%x20<%ae>%x20%ad%ncommitter%x20%cn%x20<%ce>%x20%cd%nencoding%x20%e%n%n%s%n%n%b', rev]) | |
+ call s:ReplaceCmd([dir, '-c', 'diff.noprefix=false', 'show', '--no-color', '-m', '--first-parent', '--pretty=format:commit%x20%H%ntree%x20%T%nparent%x20%P%nauthor%x20%an%x20<%ae>%x20%ad%ncommitter%x20%cn%x20<%ce>%x20%cd%nencoding%x20%e%n%n%s%n%n%b', rev]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chpwd() { | |
local new_dir=${$(pwd)#${HOME}/} | |
if [[ $new_dir == $HOME ]]; then | |
echo "Returning to home" | |
return | |
fi | |
local shell_file_path=$HOME/shells/$new_dir.zsh | |
if [[ -e $shell_file_path ]]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sample TOML configuration file for building Rust. | |
# | |
# To configure rustbuild, copy this file to the directory from which you will be | |
# running the build, and name it config.toml. | |
# | |
# All options are commented out by default in this file, and they're commented | |
# out with their default values. The build system by default looks for | |
# `config.toml` in the current directory of a build for build configuration, but | |
# a custom configuration file can also be specified with `--config` to the build | |
# system. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use goblin::Object; | |
fn main() { | |
let file = std::env::args().nth(1).unwrap(); | |
let contents = std::fs::read(file).unwrap(); | |
let obj = Object::parse(&contents).unwrap(); | |
if let Object::Elf(elf) = obj { | |
for sym in elf.dynsyms.iter() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// clang -Wall main.c -o main -DNONBLOCK | |
#include <errno.h> | |
#include <fcntl.h> | |
#include <poll.h> | |
#include <stdbool.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <termios.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Set `stdin` to non-blocking mode. | |
pub fn set_stdin_nonblocking() { | |
use nix::fcntl::{fcntl, FcntlArg, OFlag}; | |
let mut stdin_flags: OFlag = match fcntl(libc::STDIN_FILENO, FcntlArg::F_GETFL) { | |
Err(err) => { | |
panic!("Unable to read stdin flags: {:?}", err); | |
} | |
Ok(flags) => match OFlag::from_bits(flags) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![allow(dead_code)] | |
// This module implements the SSA construction algorithm described in | |
// | |
// Simple and Efficient Construction of Static Single Assignment Form | |
// (https://pp.info.uni-karlsruhe.de/uploads/publikationen/braun13cc.pdf) | |
use cranelift_entity::{entity_impl, PrimaryMap, SecondaryMap}; | |
use std::collections::HashMap; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Make CTRL-T work correctly with goto-definition. | |
setlocal tagfunc=CocTagFunc | |
nmap <leader>gre <Plug>(coc-references) | |
nmap <leader>grn <Plug>(coc-rename) | |
" nmap <leader>ge <Plug>(coc-diagnostic-info) | |
nmap <leader>ge :<C-u>CocList diagnostics<CR> | |
nmap <leader>gp <Plug>(coc-diagnostic-prev) | |
nmap <leader>gn <Plug>(coc-diagnostic-next) |