Skip to content

Instantly share code, notes, and snippets.

View erloncabral's full-sized avatar

Erlon Cabral erloncabral

View GitHub Profile
@erloncabral
erloncabral / window-class-name.md
Created October 23, 2024 12:06
Get class name for selected window
xprop | grep WM_CLASS | awk '{ print $4 }' 
@erloncabral
erloncabral / ohmyzsh-tips.md
Created October 19, 2024 19:59
ohmyzsh-tips
git clone --depth 1 -- https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone --depth 1 -- https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

~/.zshrc

plugins=(git zsh-autosuggestions zsh-syntax-highlighting)

@erloncabral
erloncabral / i3wm-tips.md
Last active October 19, 2024 15:20
i3wm-tips

Thunar mount Drives

yay -S thunar polkit-gnome

i3wm config

  • Add the following line to ~/.config/i3/config
  • exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
  • restart i3
@erloncabral
erloncabral / bst.c
Last active August 29, 2024 17:35
C - Binary Search Tree
#include <stdio.h>
#include <stdlib.h>
typedef struct BstNode {
int data;
struct BstNode *left;
struct BstNode *right;
} BstNode;
BstNode* BstNode_create(int data) {
@erloncabral
erloncabral / swift-5.0.1-ubuntu-18.04.txt
Created June 16, 2019 19:46
swift-5.0.1-ubuntu-18.04
# additional packages //https://github.com/kylef/swiftenv/issues/137
sudo apt-get install git cmake ninja-build clang python uuid-dev libicu-dev icu-devtools libbsd-dev libedit-dev libxml2-dev libsqlite3-dev swig libpython-dev libncurses5-dev pkg-config libblocksruntime-dev libcurl4-openssl-dev systemtap-sdt-dev tzdata rsync
@erloncabral
erloncabral / swift-4.2-ubuntu-19.04.txt
Created June 16, 2019 15:47
swift-4.2-ubuntu-19.04
# apple guide (linux support)
https://swift.org/download/#using-downloads
# additional link reference
https://tecadmin.net/install-swift-ubuntu-1804-bionic/
# dependency
sudo apt-get install clang libicu-dev
sudo apt-get install libcurl4 libpython2.7 libpython2.7-dev
sudo apt install gcc-aarch64-linux-gnu
@erloncabral
erloncabral / UIImage+WebP.swift
Created November 18, 2018 22:41
UIImage with WebP image data (swift 4.2)
import UIKit
extension UIImage {
convenience init?(webPData: Data) {
var width: Int32 = 0, height: Int32 = 0
if WebPGetInfo([UInt8](webPData), webPData.count, &width, &height) == 0 {
return nil
}
@erloncabral
erloncabral / keys_directions.lua
Created August 1, 2018 12:08
love 2d keyboard directions
local x_input = 0
local y_input = 0
local line_width = 32
function love.update(dt)
x_input = (love.keyboard.isDown("right") and 1 or 0) - (love.keyboard.isDown("left") and 1 or 0)
y_input = (love.keyboard.isDown("down") and 1 or 0) - (love.keyboard.isDown("up") and 1 or 0)
end
function love.draw()
@erloncabral
erloncabral / p-eiget.rb
Last active August 2, 2018 01:20
Download PICO-8 Cartridge to carts folder
#!/usr/bin/env ruby
require 'etc'
require 'open-uri'
require 'optparse'
options = {}
opts = OptionParser.new do |opts|
opts.banner = "usage: p-eiget.rb"
opts.on('-c', '-c # cartridge') do |cart|
/usr/libexec/PlistBuddy -c 'Print :UUID' /dev/stdin <<< $(security cms -D -i location_of/your.mobileprovision)
/usr/libexec/PlistBuddy -c 'Print :Name' /dev/stdin <<< $(security cms -D -i location_of/your.mobileprovision)