Skip to content

Instantly share code, notes, and snippets.

View eHammarstrom's full-sized avatar
🐚
script

Emil Hammarström eHammarstrom

🐚
script
  • Sweden
View GitHub Profile
@eHammarstrom
eHammarstrom / bash_prompt.sh
Created September 30, 2021 10:13
Cool git prompt
function mr_cool() {
local RETVAL=$(echo $?)
local RETVALCOL="\[\e[37;42m\]"
local TAIL="$(pwd)"
local TAILCOL="\[\e[37;44m\]"
local PROMPT="λ\[\e[0m\] "
local PROMPTCOL="\[\e[00;34m\]"
use smithay_client_toolkit::{
environment,
environment::{Environment, MultiGlobalHandler, SimpleGlobal},
output::{with_output_info, OutputHandler, OutputInfo},
reexports::{
client::protocol::{wl_buffer, wl_output, wl_registry, wl_shm},
client::{Attached, DispatchData, Display, EventQueue, Main, Proxy},
protocols::wlr::unstable::screencopy::v1::client::zwlr_screencopy_frame_v1,
protocols::wlr::unstable::screencopy::v1::client::zwlr_screencopy_manager_v1,
},
use gdk::prelude::*;
use gdk::DisplayManager;
fn main() {
println!("Hello, world!");
gdk::init();
let display_manager = DisplayManager::get();
let display = display_manager.get_default_display()
.expect("Found no display");
input * {
xkb_layout "us,dvorak"
xkb_options "ctrl:nocaps,grp:alt_space_toggle"
natural_scroll enabled
tap enabled
}
input * xkb_variant "dvorak"
input * xkb_options "ctrl:nocaps"
input * natural_scroll enabled
input * tap enabled
import sys
if len(sys.argv) != 2:
exit(1)
text = open(sys.argv[1], 'r').read()
words = text.replace("\n", " ").split(" ")
for i in range(1, len(words)):
HUM HIGH HUM LOW TEMP HIGH TEMP LOW PARITY
XXXX XXXX XXXX XXXX SXXX XXXX XXXX XXXX XXXX XXXX
@eHammarstrom
eHammarstrom / esp32rs.md
Last active September 13, 2019 06:50
esp32 rust

ESP32 Rust

Build LLVM for X86 (rustc) and Xtensa

  1. git clone https://github.com/espressif/llvm-xtensa.git
  2. git clone https://github.com/espressif/clang-xtensa.git llvm-xtensa/tools/clang
  3. mkdir llvm-xtensa-build && cd llvm-xtensa-build
  4. cmake ../llvm-xtensa -DLLVM_TARGETS_TO_BUILD="Xtensa;X86" -DCMAKE_BUILD_TYPE=Release -G "Ninja"
  5. cmake --build . -j X

Build & install rustc

@eHammarstrom
eHammarstrom / .tab
Created July 4, 2019 22:05
Rival Sons - Too Bad (Intro)
D Standard
D|--------------------------------X\\X--X--X--X//X--X
A|--------------------------------X\\X--X--X--X//X--X
F|--2--4-----2--------------------7\\9--9--9--9//7--7
C|--------5-----4--5--2-----------7\\9--9--9--9//7--7
G|--------------------------------5\\7--7--7--7//5--5
D|-----------------------2--1--0--X\\X--X--X--X//X--X
@eHammarstrom
eHammarstrom / ku-latency.c
Created May 24, 2019 08:40
Modified ku-latency, low overhead logging, and rtp seq
/*
Modified 2019, Emil Hammarstrom
Copyright (c) 2008, Max Vilimpoc, http://vilimpoc.org/
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met: