Skip to content

Instantly share code, notes, and snippets.

View cesalberca's full-sized avatar

César Alberca cesalberca

View GitHub Profile
@cesalberca
cesalberca / .editorconfig
Created March 23, 2017 10:56
Opinionated .editorconfig
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
charset = utf-8
@cesalberca
cesalberca / autentia-tutorial-theme.css
Created May 30, 2017 10:46
Theme skeleton styles
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
max-width: 800px;
margin: 0 auto;
color: hsla(0, 0%, 8%, 1);
font-size: 16px;
line-height: 1.8;
}
pre {
import * as React from 'react'
interface Props {
message: string
}
const Component = (props: Props) => {
const { message } = props
return (
<div>{message}</div>
import * as React from 'react'
interface Props {
message: string
}
const Component: React.StatelessComponent<Props> = props => {
const { message } = props
return (
<div>{message}</div>
async fn(a, b) {
try {
const x = await Method1(a ,b);
const y = await Method2(x[0], x[1]);
return await Method3(y);
} catch (e) {
console.log(e);
}
}
@cesalberca
cesalberca / init.lua
Last active December 19, 2018 19:08 — forked from JavierSA/init.lua
Hammerspoon configuration
local MASH = {"cmd", "alt", "ctrl"}
local MASH_SHIFT = {"cmd", "alt", "ctrl", "shift"}
local focusedWindow
local focusedWindowFrame
local screenFrame
hs.grid.MARGINX = 0
hs.grid.MARGINY = 0
@cesalberca
cesalberca / tsconfig.json
Last active December 18, 2020 15:59
TypeScript Strict Options
{
"compilerOptions": {
"strict": true,
"noFallthroughCasesInSwitch": true,
"noUnusedParameters": true,
"noUnusedLocals": true,
"forceConsistentCasingInFileNames": true
}
}
import { Maybe } from './maybe'
describe('Maybe', () => {
it('should handle a value', () => {
const maybe = Maybe.some('test')
expect(maybe.getOrElse('')).toBe('test')
})
it('should handle an undefined value', () => {
const maybe = Maybe.fromValue<string>(undefined)
name: CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
name: CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1