Skip to content

Instantly share code, notes, and snippets.

View rockymadden's full-sized avatar
:octocat:
Setting status

Rocky Madden rockymadden

:octocat:
Setting status
  • UiPath
  • Pale Blue Dot
View GitHub Profile
@n1snt
n1snt / Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md
Last active May 29, 2024 20:40
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.

@zeusdeux
zeusdeux / Either.ts
Last active February 19, 2024 19:20
Another Maybe and Either implementation in Typescript without making the value constructors (Just, Nothing, Left and Right) types themeselves as in the previous attempt
// Either monad using discriminated unions
export type Either<L, R> =
| { type: "left"; value: L }
| { type: "right"; value: R };
export function Left<L, R>(a: L): Either<L, R> {
return {
type: "left",
value: a
};
@glebec
glebec / lenses.js
Last active January 25, 2019 23:06
Lenses in JS
/**
* Van Laarhoven Lenses in JavaScript
* by Gabriel Lebec (https://github.com/glebec)
*
* Based on https://www.codewars.com/kata/lensmaker
* See also https://github.com/ekmett/lens/wiki/History-of-Lenses
*/
/**
* Composition and Combinators
@glebec
glebec / monadic-parser.js
Last active June 2, 2021 10:22
Monadic Parser demo
/**
* Minimal demo of parser combinators, possibly as a target for recent
* JS web dev graduates to implement as an exercise.
*
* Huge credit to Hutton, Meijer, and Swierstra for their papers
* on the subject.
*/
class Parser {
@gabejohnson
gabejohnson / infix.js
Last active December 19, 2018 16:52
Because I'm lazy and mixfix w/ proxies is slow
var isWrapper = Symbol('isWrapper');
function _(arg, args=[], ops=[]) {
const myArgs = args.concat([arg]);
const myOps = ops.slice(0);
const f = ([op]) => (
myOps.push(op),
wrap(arg2 => _(arg2, myArgs, myOps), myArgs, myOps)
);
@gabejohnson
gabejohnson / fix.js
Last active December 19, 2018 16:52
So you know how you've always wanted to write custom *fix operators? You haven't?!?! Well this isn't for you then
// fix.js
// _has :: String => Boolean
var _has = k => _[k] != null;
// last :: Array a => a?
var last = xs => xs[xs.length-1];
// copyArray :: Array a => Array a
var copyArray = xs => xs.slice(0);
@gunar
gunar / await-to-js-no-throw.js
Last active January 5, 2021 00:26
Async Control Flow without Exceptions nor Monads
'use strict'
const toUpper = async string => {
if (string === 'invalid') return [Error('Invalid input')]
return [null, string.toUpperCase()]
}
const errorHandler = () => { console.log('There has been an error. I\'ll handle it.') }
const print = console.log
const foo = async input => {
@judy2k
judy2k / parse_dotenv.bash
Created March 22, 2017 13:34
Parse a .env (dotenv) file directly using BASH
# Pass the env-vars to MYCOMMAND
eval $(egrep -v '^#' .env | xargs) MYCOMMAND
# … or ...
# Export the vars in .env into your shell:
export $(egrep -v '^#' .env | xargs)

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@burdara
burdara / ubuntu_ixgbevf_upgrade.sh
Created November 2, 2016 17:07
AWS enhanced networking - Ubuntu ixgbevf driver upgrade.
#/usr/bin/env bash
set -x
name="ixgbevf"
version="2.16.4"
file_name="$name-$version"
archive_name="$file_name.tar.gz"
tmp_path="/tmp"
src_path="/usr/src"
wget_src="sourceforge.net/projects/e1000/files/$name stable/$version/$archive_name"