Skip to content

Instantly share code, notes, and snippets.

View SmallEndian's full-sized avatar

Jonathan Sid-Otmane SmallEndian

View GitHub Profile
@SmallEndian
SmallEndian / bt-choice.sh
Last active November 15, 2023 22:24
Rofi - bluetoothctl choice
#!/usr/bin/env -S bash -e
# This script is meant to be called through rofi
# Hopefully as an element of polybar
# Polybar config
#
# rofi -show bt -modes "bt:bt-choice.sh"
#
# [module/bt]
# type = custom/script
@SmallEndian
SmallEndian / git_convert.sh
Last active November 30, 2023 23:22
Automagically convert https to ssh for git links
git config --global url.ssh://git@github.com/.insteadOf https://github.com/
@SmallEndian
SmallEndian / init.vim
Created February 16, 2022 01:25
Hover through the documentation in CoC
" Use K to show documentation in preview window.
" For most purposes (mostly class), it's better to keep the call to man
au Filetype rust,java,go nnoremap <silent> K :call <SID>show_documentation()<CR>
"nnoremap <silent> K :call <SID>show_documentation()<CR>
function! s:show_documentation()
if (index(['vim','help'], &filetype) >= 0)
execute 'h '.expand('<cword>')
else
call CocAction('doHover')
@SmallEndian
SmallEndian / howto.md
Last active February 20, 2024 18:54
Change rustdoc's default theme

While all rust documentation has some pretty nice themes, it's a bother to have to select the proper theme for evey single repo, and sometimes this choice does not affect other modules.

Simply add this to your ENV.

# .zshrc
export RUSTDOCFLAGS="--default-theme=ayu"

There's a better way to do this, it's to modify the Cargo doc. So that's a toml file that is held in the user directory.

@SmallEndian
SmallEndian / JUnit.md
Last active August 27, 2021 12:56
Using JUnit in a Java Project

Using JUnit in a Java Project

How to setup everything when you don't use either or

  • Maven
  • Gradle
  • Ant
  • Eclipse
  • IntelliJ

How I compile my Java code

@SmallEndian
SmallEndian / org.freedesktop.DBus.rs
Created February 22, 2021 22:40
Auto generated DBus rust
// This code was autogenerated with `dbus-codegen-rust -nd org.freedesktop.DBus`, see https://github.com/diwic/dbus-rs
use dbus as dbus;
#[allow(unused_imports)]
use dbus::arg;
use dbus_tree as tree;
pub trait OrgFreedesktopDBus {
fn hello(&self) -> Result<String, tree::MethodErr>;
fn request_name(&self, arg0: &str, arg1: u32) -> Result<u32, tree::MethodErr>;
fn release_name(&self, arg0: &str) -> Result<u32, tree::MethodErr>;
@SmallEndian
SmallEndian / usernames
Last active May 22, 2024 10:55
All failed logins since 14/07/2019
!
#
%
&
(
)
*
*****
+
=
@SmallEndian
SmallEndian / Dockerfile
Last active August 5, 2019 17:03
Antidote, local docker setup
FROM erlang:21
ENV HANDOFF_PORT "8099"
ENV PB_PORT "8087"
ENV PB_IP "0.0.0.0"
ENV PBSUB_PORT "8086"
ENV LOGREADER_PORT "8085"
ENV RING_STATE_DIR "data/ring"
ENV PLATFORM_DATA_DIR "data"
ENV NODE_NAME "antidote@127.0.0.1"

Keybase proof

I hereby claim:

  • I am smallendian on github.

  • I am smallendian (https://keybase.io/smallendian) on keybase.

  • I have a public key ASCEFdA345wLsY7KnMtOkT8HMR_2Xn8QHtOl1z8TbllHHAo

@SmallEndian
SmallEndian / gitinit.py
Created June 4, 2019 11:35
Create github repos on the fly
#!/usr/bin/env python3
"""
gitinit: For these times when you want push your current repository to github. gitinit creates a new public or private repository and then outputs the new url to configure your git remote.
Pushing with https is _bad_, so that info is not shown
"""
__author__ = "Jonathan Sid-Otmane"
import os
import sys