Skip to content

Instantly share code, notes, and snippets.

View alejandronanez's full-sized avatar
🌴
vacations - don’t expect a response.

Alejandro Ñáñez Ortiz alejandronanez

🌴
vacations - don’t expect a response.
View GitHub Profile
@fatehMohamed14
fatehMohamed14 / BinaryGap solution
Last active January 18, 2024 14:22
BinaryGap Codility solution, A binary gap within a positive integer N is any maximal sequence of consecutive zeros that is surrounded by ones at both ends in the binary representation of N
function solution(N) {
const binary = N.toString(2);
let gaps = [];
let count = 0;
for(let b of binary) {
if(b === "0") {
count++
} else {
gaps.push(count);
count = 0
@justincy
justincy / README.md
Last active April 5, 2024 22:19
Configure Storybook to work with Next.js, TypeScript, and CSS Modules

In addition to the Storybook for React setup, you'll also need to install these packages:

npm i -D @babel/core babel-loader css-loader style-loader
@alejandronanez
alejandronanez / cloudSettings
Last active August 6, 2019 02:58
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-08-06T02:46:34.859Z","extensionVersion":"v3.4.1"}
@busypeoples
busypeoples / README.md
Last active February 8, 2022 08:41
Making Impossible States Impossible in ReasonML

Making Impossible States Impossible in ReasonML

Introduction

If you have already seen Richard Feldman's talk entitled "Making Impossible States Impossible" or have read "Designing with types: Making illegal states unrepresentable" then you can skip the explanations and just head straight to the Reason examples.

This post is intended to display how to model your Reason Application to prevent creating impossible states. The benefits of being able to design a feature in this way include avoiding having to deal with complex test scenarios regarding defined business rules and a clear documentation of what is possible just by looking at the type definition. Long story short, let's see how this all works by implementing an example.

Requirements

@ldez
ldez / gmail-github-filters.md
Last active May 16, 2024 11:07
Gmail and GitHub - Filters

Gmail and GitHub

How to filter emails from GitHub in Gmail and flag them with labels.

The labels in this document are just examples.

Pull Request

Filter Label
@justgage
justgage / HowToElm.md
Last active January 17, 2020 23:49
How To Elm

How to Elm

This is a basic guide on how to learn Elm rather than actually teach you. I'm going to mostly link to resources that I feel are valuable and try to "teach you how to fish".

The main purpose is to accelerate your learning and save you a lot of googling and weeding through bad explinations.

Essential links

* what it's like to not be technical in the industry
* what you do in tech that people forget is needed
* the most interesting thing you've worked on recently
* what your day-to-day is like
* must-have gifs for every techie
* horrible code from the past that shows I'm much better now
* the best music for hacking
* mistakes you've made that make you groan
* how you've made it at well-known companies
* self-care in the tech bubble
@brandondurham
brandondurham / styles.less
Last active January 11, 2024 06:46
Using Operator Mono in Atom
/**
* Using Operator Mono in Atom
*
* 1. Open up Atom Preferences.
* 2. Click the “Open Config Folder” button.
* 3. In the new window’s tree view on the left you should see a file called “styles.less”. Open that up.
* 4. Copy and paste the CSS below into that file. As long as you have Operator Mono SSm installed you should be golden!
* 5. Tweak away.
*
* Theme from the screenshot (http://cdn.typography.com/assets/images/blog/operator_ide2.png):
@branneman
branneman / composition.js
Last active April 15, 2018 19:51
OO JavaScript: Inheritance vs. Composition
//
// hasPosition trait
//
const hasPosition = state => ({
setPosition: function(x, y) {
this.x = x;
this.y = y;
}.bind(state)
});
@Shoozza
Shoozza / agent.cmd
Last active April 20, 2022 02:45
Make Cmder work with ssh-agent
@ECHO OFF
SETLOCAL
GOTO:MAIN
REM
REM Info functions start
REM
REM Display version and copyright information
:VERSION