Skip to content

Instantly share code, notes, and snippets.

View CoffiDev's full-sized avatar
🏠
Working from home

Alejandro Cuenca Estrada CoffiDev

🏠
Working from home
View GitHub Profile
@Nuigurumi777
Nuigurumi777 / autolayer.py
Last active February 15, 2024 03:16
An example of sending layer changing commands from Windows host to Moonlander keyboard
import ctypes
import hid, sys
import time
user32 = ctypes.windll.user32
def get_active_language():
h_wnd = user32.GetForegroundWindow()
thread_id = user32.GetWindowThreadProcessId(h_wnd, 0)
klid = user32.GetKeyboardLayout(thread_id)
@getify
getify / monads-and-friends.md
Created July 16, 2020 19:38
Monads and Friends...

Monads and Friends...

Over the last 24-48 hours, I've fielded quite a flurry of tweets related to a couple of threads I posted recently. Upon reflection on the feedback, especially the negative stuff, I decided to write this blog post to clarify a few things about my background on the topic, what I was trying to say, what I've done so far, and what I'm hoping to do (and learn!) in the future.

It's a bit of a lengthy read, but if you find you've got the time, I hope you'll read it.

To be clear, the feedback has been on a broad spectrum. A lot of it was actually quite positive, people thanking me and appreciating my continued efforts to try to make dev topics approachable. As a matter of fact, over the years, I've received boat loads of such positive feedback, and I'm tremendously grateful that I've had a helpful impact on so many lives.

But some of it veered decidedly the other direction. I'm deliberately not linking to it, because I don't want to either amplify or gang up on those folks. I'm offended an

async function validatePassword(password: string): string[] {
let errors = []
// 1. Don't regex for things you can trivially express in code
// -----------------------------------------------------------
// For example, we could have written this as `/^.{0,7}$/` but that's not
// nearly as clear as checking the length of the string.
if (password.length < 8) {
errors.push("Password must be at least 8 characters long")
@thesved
thesved / roam-table-embed.css
Created June 5, 2020 22:56
Team Alignment Map in Roam Research
/* don't limit the block width for tables */
.rm-block-text {
max-width: none!important;
}
/* clean up tables embedded in tables and blocks within tables */
.roam-table, .roam-table th, .roam-table td, .roam-table tr {
padding:0!important;
vertical-align: top;
min-width:auto!important;
[server]
SERVER
[server:vars]
server_name=SERVER
[email protected]
docker_nginx_ssl=true
@chalsy87
chalsy87 / webPack-VSCode-Jest-alias-configuration.md
Created December 14, 2018 07:09
Use of alias in VSCode with Jest in a typeScript/JavaScript project

webPack-VSCode-Jest-alias-configuration

This are the necessary steps about How to configure alias in WebPack, VSCode and Jest.

Problem: We want to avoid the type of imports where you have to 'calculate' the path, intead of that we want to use a more friendly alias.

Frontend Masters: AWS for Frontend Engineers

You should have the following completed on your computer before the workshop:

  • Install the AWS CLI.
  • Have Node.js installed on your system. (Recommended: Use nvm.)
    • Install yarn with brew install yarn.
  • Create an AWS account. (This will require a valid credit card.)
  • Create a Travis CI account. (This should be as simple as logging in via GitHub).
@gvolpe
gvolpe / di-in-fp.md
Last active September 16, 2024 07:18
Dependency Injection in Functional Programming

Dependency Injection in Functional Programming

There exist several DI frameworks / libraries in the Scala ecosystem. But the more functional code you write the more you'll realize there's no need to use any of them.

A few of the most claimed benefits are the following:

  • Dependency Injection.
  • Life cycle management.
  • Dependency graph rewriting.
@PCreations
PCreations / rxjs-diagrams.md
Last active September 26, 2024 01:44
Super Intuitive Interactive Diagrams to learn combining RxJS sequences by Max NgWizard K
@Jonalogy
Jonalogy / handling_multiple_github_accounts.md
Last active November 14, 2024 08:31
Handling Multiple Github Accounts on MacOS

Handling Multiple Github Accounts on MacOS

The only way I've succeeded so far is to employ SSH.

Assuming you are new to this like me, first I'd like to share with you that your Mac has a SSH config file in a .ssh directory. The config file is where you draw relations of your SSH keys to each GitHub (or Bitbucket) account, and all your SSH keys generated are saved into .ssh directory by default. You can navigate to it by running cd ~/.ssh within your terminal, open the config file with any editor, and it should look something like this:

Host *
 AddKeysToAgent yes

> UseKeyChain yes