Skip to content

Instantly share code, notes, and snippets.

View ubaldop's full-sized avatar
🎣
A fisherman, after all.

Ubaldo Pescatore ubaldop

🎣
A fisherman, after all.
View GitHub Profile
@AndreaMinato
AndreaMinato / auth.ts
Last active June 20, 2023 00:55
Typescript Vuex Module
import axios, { AxiosRequestConfig } from "axios";
import router from "@/router"; //shortcut to src
import { Module } from "vuex";
const authModule: Module<any, any> = {
state: {
loggedIn: false,
loginError: null,
username: null

Characterize recursable data structures

Recursion

Recursion is a procedure that allows us to iterate through certain data structure. For example we can iterate through lists

sum : List Nat -> Nat
sum list =
@tgallant
tgallant / pm.erl
Last active February 26, 2017 20:42
-module(pm).
-export([perimiter/1,area/1,enclosure/1,linearBits/1,bits/1]).
%% Shape objects:
%%
%% For the sake of brevity, all shape values
%% are expected to be positive integers.
%%
%% {circle, Radius}
%% {rectangle, {Width,Height}}
@morgaine
morgaine / fib_multi.erl
Last active September 17, 2019 18:28
Fibonacci in Erlang, multiple algorithms, commandline interface
#! /bin/env escript
% NAME
% fib_multi.erl -- Multiple algorithms for Fibonacci numbers
%
% SYNOPSIS
% fib_multi {from-integer} [{to-integer}]
%
% INSTALL
% ln -s fib_multi.erl fib_multi

Applied Functional Programming with Scala - Notes

Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
@mnem
mnem / git_fetch_pull_all_subfolders.sh
Created December 6, 2011 14:35
Simple bash script for fetching and pulling all repos in the executed folder to the latest of the branch they are on
#!/bin/bash
################
# Uncomment if you want the script to always use the scripts
# directory as the folder to look through
#REPOSITORIES="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
REPOSITORIES=`pwd`
IFS=$'\n'