Skip to content

Instantly share code, notes, and snippets.

View Kaylebor's full-sized avatar

Ender Kaylebor

View GitHub Profile
@Kaylebor
Kaylebor / project-import-scan.py
Last active April 4, 2018 07:49
project-import-scan.py
#!/usr/bin/env python
import csv
import re
import os
topdir=r'folderToScan'
output=r'outputFile.csv'
exten='.extension'
def parsesource(firstfolder,filepath,filename,sourcefile):
@Kaylebor
Kaylebor / my-regexes.txt
Created February 23, 2017 08:09
List of difficult regexes I've used. Over time, entries might become more complicated.
/(?!-,)(?!^,)(^-?\d*,?\d{0,2}$)/ //Number, positive or negative, with up to two decimals
@Kaylebor
Kaylebor / arrayFunctions.js
Last active March 31, 2017 15:27
Processing of arrays of strings
/* Checks if a string is contained inside the given array of strings
* If the second variable is a string, it just compares them
* If the second variable is neither string or array, it returns false */
function checkIfStringInArray(str, arr) {
if (typeof arr === 'string')
return str === arr;
if (arr.constructor && arr.constructor === Array)
for (var i in arr) {
if (str === arr[i]) {
return true;
@Kaylebor
Kaylebor / init.vim
Last active June 25, 2020 21:26
My Neovim configuration file
" Save as $HOME/.config/nvim/init.vim
" Dependencies
" vim-plug: https://github.com/junegunn/vim-plug
" Specify a directory for plugins
" - For Neovim: ~/.local/share/nvim/plugged
" - Avoid using standard Vim directory names like 'plugin'
call plug#begin('~/.local/share/nvim/plugged')
@Kaylebor
Kaylebor / setup_proxy_script.sh
Last active January 31, 2019 15:53
Settings for a user behind a corporate MITM-style proxy on a Debian-based system
#! /bin/bash
#
# setup_proxy_script.sh
# Copyright (C) 2019 Ender Veiga Bueno <enderveigabueno@pm.me>
#
# Distributed under terms of the MIT license.
#
# Check that the script is being run as root (sudo ./setup_proxy_script.sh)
if [ "$EUID" -ne 0 ]
#!/usr/bin/env sh
#===========================================================================================#
# This script is a workaround for compiling Erlang with crypto below version 20 via kerl #
# #
# The need for this script came about because newer versions of OpenSSL are not #
# properly detected by the compiler when choosing an Erlang version under 20; #
# most distros have an openssl 1.0 compatibility package in their package managers, #
# but I have found them unreliable at best, when it comes to compiling Erlang #
# #
# The script will download the OpenSSL source code for version 1.0.2 to $HOME/openssl, #
@Kaylebor
Kaylebor / keybindings-fix.zsh
Created October 26, 2019 10:42
Fix for several key combinations on zsh
case "${TERM}" in
cons25*|linux) # plain BSD/Linux console
bindkey '\e[H' beginning-of-line # home
bindkey '\e[F' end-of-line # end
bindkey '\e[5~' delete-char # delete
bindkey '[D' emacs-backward-word # esc left
bindkey '[C' emacs-forward-word # esc right
;;
*rxvt*) # rxvt derivatives
bindkey '\e[3~' delete-char # delete
%% @doc
%% USAGE:
%% In the $HOME folder, create a file called .erlang
%% On that file, write the following line:
%%
%% code:load_abs("/path/to/user_default").
%%
%% Note that user_default must have been compiled
%% (there must be a user_default.beam file in the folder)
%%

Keybase proof

I hereby claim:

  • I am kaylebor on github.
  • I am kayleb0r (https://keybase.io/kayleb0r) on keybase.
  • I have a public key ASBTg5kksTEo9YCR2jxPPVzp2DibDvtEnshJGP71LzjrDAo

To claim this, I am signing this object:

@Kaylebor
Kaylebor / sh
Last active June 7, 2021 12:36
Remove Mobvoi apps (bloat) from TicWatch using GNU Parallels
parallel adb shell pm uninstall -k --user 0 ::: $(adb shell pm list packages mobvoi | cut -d: -f2)