Skip to content

Instantly share code, notes, and snippets.

View gleydson404's full-sized avatar

Gleydson Cavalcante gleydson404

  • @ALDI-SOUTH-IT
  • Mülhein an der Rhur, Germany
View GitHub Profile
@gleydson404
gleydson404 / keychron_linux.md
Created January 28, 2022 18:26 — forked from andrebrait/keychron_linux.md
Keychron keyboards on Linux (+ Bluetooth fixes)

Here is the best setup (I think so :D) for Keychron + Linux

Make Fn + F-keys work

Keychron Keyboards on Linux use the hid_apple driver (even in Windows/Android mode), both in Bluetooth and Wired modes. By default, this driver uses the F-keys as multimedia shortcuts and you have to press Fn + the key to get the usual F1 through F12 keys.

In order to change this, you need to change the fnmode parameter for the hid_apple kernel module. Here's some documentation on it, but a quick summary can be found below:

@gleydson404
gleydson404 / bhaskara.scala
Last active June 26, 2020 23:52
A simple implementation of Bhaskara formula
import scala.math.sqrt
import scala.math.pow
object Bhaskara {
def bhaskara(a: Int, b: Int, c: Int): List[Double] = {
def delta(a: Int, b: Int, c: Int): Int = (pow(b, 2) - 4 * a * c).toInt
val delta_result = delta(a, b, c)z
val result = delta_result match {
@gleydson404
gleydson404 / bhaskara.clj
Last active June 23, 2020 22:09
A first version of a clojure script to calculate baskara.
(defn delta [a b c] (- (Math/pow b 2) (* 4 a c ) ) )
(defn r1 [a b c] (/ (+ (* b -1) (Math/sqrt (delta a b c))) (* 2 a)))
(defn r2 [a b c] (/ (- (* b -1) (Math/sqrt (delta a b c))) (* 2 a)))
(defn baskara [a b c]
(if (> (delta a b c) 0)
[(r1 a b c) (r2 a b c)]
(if (= (delta a b c) 0.0)
[(r1 a b c)]
"Delta is negative"
)
@gleydson404
gleydson404 / conf
Last active August 3, 2020 18:35
my .config/termite/conf
[options]
#allow_bold = true
#audible_bell = false
#bold_is_bright = true
#clickable_url = true
#dynamic_title = true
# font = Monospace 9
font = Droid Sans Mono 11
#fullscreen = true
#icon_name = terminal
@gleydson404
gleydson404 / init.vim
Last active June 28, 2020 21:24
My neovim init.vim file.
call plug#begin()
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-fugitive'
Plug 'mileszs/ack.vim'
Plug 'terryma/vim-multiple-cursors'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
" Plug 'neomake/neomake'
@gleydson404
gleydson404 / .zshrc
Last active June 28, 2020 21:33
my oh-my-zsh config
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
#if you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
@gleydson404
gleydson404 / tmux.conf
Created July 11, 2017 18:48 — forked from spicycode/tmux.conf
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000

Desafio de Machine Learning da Nama!

Este é um desafio elaborado para que a Nama consiga avaliar seus conhecimentos tanto em Machine Learning, como implementação prática desses conhecimentos. Entendemos que além de modelar o problema, o profissional de Machine Learning que procuramos deve ter um bom background de desenvolvimento, envolvendo boas práticas, para que o conhecimento e valor gerado no seu trabalho, possa ser aproveitado no futuro.


O Desafio

@gleydson404
gleydson404 / djangoScript.py
Created August 11, 2016 02:02
If you are having problems like "django.core.exceptions.AppRegistryNotReady: Models aren't loaded yet", this could be helpfull. Credits to http://www.dangtrinh.com/2014/11/how-to-avoid-models-arent-loaded-yet.html
#! /usr/bin/env python
def setup_environment():
pathname = os.path.dirname(sys.argv[0])
sys.path.append(os.path.abspath(pathname))
sys.path.append(os.path.normpath(os.path.join(os.path.abspath(pathname), '../')))
os.environ['DJANGO_SETTINGS_MODULE'] = 'myapp.settings'
setup_environment()
@gleydson404
gleydson404 / tmux-cheatsheet.markdown
Created May 23, 2016 03:14 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname