Skip to content

Instantly share code, notes, and snippets.

View joshuapassos's full-sized avatar
🐨
Focusing

Joshua Passos joshuapassos

🐨
Focusing
View GitHub Profile
#Generated by Kickstart Configurator
#platform=x86
#System language
lang en_US
#Language modules to install
langsupport en_US
#System keyboard
keyboard br
#System mouse
-- 1 Problem 1
-- (*) Find the last element of a list.
_myLast :: [a] -> a
_myLast [] = error "empty list"
_myLast [x] = x
_myLast (_:xs) = _myLast xs
-- 2 Problem 2
{
"defaultSeverity": "error",
"linterOptions": {
"exclude": [
"src/**/api.ts",
"src/spec/**",
"src/**/*.d.ts",
"src/**/spec*.ts"
]
},
### Keybase proof
I hereby claim:
* I am joshuapassos on github.
* I am joshuapassos (https://keybase.io/joshuapassos) on keybase.
* I have a public key ASD7zJ9ALQU_2oS4N_2Y3H1f6Xidxc4Fh4KFFW-uTOJHpAo
To claim this, I am signing this object:
@joshuapassos
joshuapassos / test.hs
Created August 28, 2017 14:36
example State monad
import Control.Monad.State
-- Example use of State monad
-- Passes a string of dictionary {a,b,c}
-- Game is to produce a number from the string.
-- By default the game is off, a C toggles the
-- game on and off. A 'a' gives +1 and a b gives -1.
-- E.g
-- 'ab' = 0
-- 'ca' = 1
@joshuapassos
joshuapassos / js
Created July 27, 2016 05:24
parser.l
/* Refutation Tree by Josh */
%lex
%%
\s*\n\s* {/* ignore */}
{-# LANGUAGE DataKinds, KindSignatures, TypeOperators, GADTs, TypeFamilies, UndecidableInstances #-}
{- about invariants -}
data NatPos = One | Succ NatPos
data SingleNatPos :: NatPos -> * where
SingleOne :: SingleNatPos One
SingleSucc :: SingleNatPos natpos -> SingleNatPos (Succ natpos)
type family (m :: NatPos) |+| (n :: NatPos) :: NatPos where
@joshuapassos
joshuapassos / 0_reuse_code.js
Last active August 29, 2015 14:19
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@joshuapassos
joshuapassos / Tridiagonal.py
Created February 21, 2015 03:53
Tridiagonal
import math
print """Para escrever um vetor voce usa a seguinte notacao:
a = [1,2,3,4,5]
Depois que voce inserir os vetores voce coloca:
solve(a,b,c,d)
"""
b = 9*[-4]
a = 8*[1.9]
c = 8*[2.1]