Skip to content

Instantly share code, notes, and snippets.

View nachocodexx's full-sized avatar
🚀
Working from home

Nacho Castillo nachocodexx

🚀
Working from home
View GitHub Profile
@Integralist
Integralist / main.rs
Last active June 16, 2023 00:18
[Rust Tokio Spawn and Retry] #rust #async #retry
use std::any::type_name;
use tokio_retry::strategy::{jitter, FixedInterval};
use tokio_retry::Retry;
#[derive(Debug)]
struct ImageId {
id: Option<String>,
}
async fn action() -> Result<ImageId, ()> {
@n1snt
n1snt / Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md
Last active November 19, 2024 03:17
Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

@darthbhyrava
darthbhyrava / asus_kbd.md
Last active July 27, 2022 01:48
ASUS KeyBoard Backlight : Some Comments

ASUS TUF Keyboard Backlight Not Working on Ubuntu

I'm facing this exact issues on my ASUS TUF FX505.

  • The keyboard function keys don't work: FN + <Up>, FN + <Down>
  • /sys/class/leds/ (how linux kernel handles leds) does not have a corresponding device:
~[/sys/class/leds]$ tree .
.
├── asus-wireless::airplane -> ../../devices/LNXSYSTM:00/LNXSYBUS:00/ATK4002:00/leds/asus-wireless::airplane
@nachocodexx
nachocodexx / README-Template.md
Created June 30, 2018 05:02 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@nachocodexx
nachocodexx / ESPWebForm.ino
Created February 8, 2018 00:02 — forked from bbx10/ESPWebForm.ino
Demonstrate using an http server and an HTML form to control an LED. The http server runs on the ESP8266.
/*
* Demonstrate using an http server and an HTML form to control an LED.
* The http server runs on the ESP8266.
*
* Connect to "http://esp8266WebForm.local" or "http://<IP address>"
* to bring up an HTML form to control the LED connected GPIO#0. This works
* for the Adafruit ESP8266 HUZZAH but the LED may be on a different pin on
* other breakout boards.
*
* Imperatives to turn the LED on/off using a non-browser http client.
@jpallari
jpallari / article.org
Last active November 9, 2022 18:46
Enforcing invariants in Scala datatypes

Enforcing invariants in Scala datatypes

Scala provides many tools to help us build programs with less runtime errors. Instead of relying on nulls, the recommended practice is to use the Option type. Instead of throwing exceptions, Try and Either types are used for representing potential error scenarios. What’s common with these features is that they’re used for capturing runtime features in the type system, thus lifting the runtime scenario handling to the compilation phase: your program doesn’t compile until you’ve explicitly handled nulls, exceptions, and other runtime features in your code.

In his “Strategic Scala Style” blog post series,

@dzitkowskik
dzitkowskik / SeleniumGridTutorial.md
Last active May 8, 2024 06:51
A simple tutorial of using selenium grid in python unittests

Prepare files & libraries

  1. Download selenium standalone server from: http://goo.gl/rQhaxb, Create local folder at ~/selenium and copy or move jar to that path:
$ mkdir ~/selenium
$ cd ~/selenium
$ wget http://goo.gl/rQhaxb
$ mv selenium-server-standalone-2.49.1.jar ~/selenium/
@milessabin
milessabin / tuplegeneric.scala
Last active March 13, 2023 20:27
Convert (small enough) case classes to and from tuples using shapeless ...
import shapeless._
import ops.hlist.Tupler
trait TupleGeneric[C <: Product] extends Serializable {
type Repr <: Product
def to(t : C) : Repr
def from(r : Repr) : C
}
@noelwelsh
noelwelsh / loop.scala
Created October 15, 2015 16:18
Example of monadic loop using the State monad in Cats
import cats.{Id,Monad}
import cats.state.State
import cats.std.function._
import scala.language.higherKinds._
// Call Example.example.run to see the example running
object Example {
type MyState[A] = State[Int, A]
@PurpleBooth
PurpleBooth / README-Template.md
Last active November 17, 2024 18:07
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites