Skip to content

Instantly share code, notes, and snippets.

View easbarba's full-sized avatar
☀️
Praise the sun!

Alexander Barbosa easbarba

☀️
Praise the sun!
View GitHub Profile
@folke
folke / lua-lsp.lua
Last active March 7, 2023 19:17
Correct sumneko lua lsp setup for init.lua and plugin development
-- put this file somewhere in your nvim config, like: ~/.config/nvim/lua/config/lua-lsp.lua
-- usage: require'lspconfig'.sumneko_lua.setup(require("config.lua-lsp"))
local library = {}
local path = vim.split(package.path, ";")
-- this is the ONLY correct way to setup your path
table.insert(path, "lua/?.lua")
table.insert(path, "lua/?/init.lua")
@sesopenko
sesopenko / Makefile
Last active May 8, 2021 22:20
Automated, complete dev environment setup for building Phoenix web apps in Ubuntu 20.10 with Docker and MariaDB
LSB_RELEASE := $(shell lsb_release -cs)
WHOAMI := $(shell whoami)
SYSTEM := $(shell uname -s)
ARCH := $(shell uname -m)
NODE_VERSION := 14
PHOENIX_VERSION := 1.5.8
install-nodejs:
cd /tmp/
curl -sL https://deb.nodesource.com/setup_$(NODE_VERSION).x -o nodesource_setup.sh
@alphapapa
alphapapa / dired.sh
Last active April 4, 2021 09:37
Standalone Dired launcher
#!/bin/bash
# Launch Dired in a plain Emacs configuration.
# Arguments are passed to Emacs, e.g. "-nw" works as expected.
emacs -q "$@" \
--eval "(dired default-directory)" \
--eval "(defun kill-window-or-emacs () (interactive) (if (one-window-p) (kill-emacs) (delete-window)))" \
--eval "(setq dired-dwim-target t delete-by-moving-to-trash t)" \

Guix on WSL2

(updated versions of this document, plus more, live here)

This will show you how to get Guix running on WSL2.
We're going to go as "minimal" as possible, without starting off one of the readily available WSL2 distros.
Parts of this guide should help with understanding how to set up any custom distro on WSL, not just Guix.

Disclaimer: I'm a Guix nOOb! (hence going through the trouble of installing it on WSL2)

@dsshep
dsshep / records.cs
Last active March 16, 2020 13:59
Record like functionality in C#
// In F# if we have a record and instance:
type RecordOne = {
PropOne: string
PropTwo: int
}
let recordOne = { PropOne = "PropOne"; PropTwo = 1 }
// it can then be updated as so:
(defun narrow-or-widen-dwim (p)
;; fixed to behave correctly in org-src buffers; taken from:
;; https://lists.gnu.org/archive/html/emacs-orgmode/2019-09/msg00094.html
"Widen if buffer is narrowed, narrow-dwim otherwise.
Dwim means: region, org-src-block, org-fixed-width-region,
org-table-field, org-subtree, or defun, whichever applies
first. Narrowing to:
- org-src-block calls `org-edit-src-code'
@ejpcmac
ejpcmac / .envrc
Created September 28, 2018 20:55
.envrc for Phoenix projects using Nix and PostgreSQL
####################################
# Environment setup for Nix shells #
####################################
# From https://github.com/direnv/direnv/wiki/Nix#persistent-cached-shell
#
# Usage: use_nix [...]
#
# Load environment variables from `nix-shell`.
# If you have a `default.nix` or `shell.nix` one of these will be used and
@jhoff
jhoff / README.md
Last active April 1, 2024 07:45
Bash-only Laravel Artisan tab auto-complete

If you are an Oh-my-zsh user, see the Laravel 5 plugin

For the rest of us Bash users, all of the Laravel Artisan autocomplete solutions out there require installing a composer package to get a list of artisan commands. Turns out this isn't really necessary. Simply add the provided code in ~/.bash_profile ( or similarly sourced file ) and you'll get artisan command tab completes on any project on your system.

_artisan()
{
	COMP_WORDBREAKS=${COMP_WORDBREAKS//:}
	COMMANDS=`php artisan --raw --no-ansi list | sed "s/[[:space:]].*//g"`
	COMPREPLY=(`compgen -W "$COMMANDS" -- "${COMP_WORDS[COMP_CWORD]}"`)
@MWins
MWins / project-ideas01.md
Last active November 14, 2024 14:30
Back end Projects - list

Project Ideas

Ok. I'm going to list off some ideas for projects. You will have to determine if any particular idea is good enough to include in a portfolio. These aren't creative ideas. They likely already exist. Some are way too advanced while others are simplistic.

I will recommend to post any project you make to github and make a github project page for it. Explain in as much detail as possible how you made it, how it can be improved etc. Document it.

If you pick an advanced idea, setup a development roadmap and follow it. This will show some project management skills.

Another piece of advice for those who are design challenged. Use different front end frameworks and use different themes for those frameworks to provide appealing designs without looking like yet another bootstrap site.