This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
const path = require('path') | |
const chokidar = require('chokidar') | |
const http = require('http') | |
const clients = [] | |
http.createServer((req, res) => { | |
return clients.push( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SELECT DETECT | |
Book = Struct.new(:title, :author, :status) | |
lord_of_the_rings = Book.new('Lord of the Rings', 'Tolkien', :read) | |
silmarillion = Book.new('Silmarillion', 'Tolkien', :read) | |
clean_code = Book.new('Clean code', 'Martin', :read) | |
books = [ lord_of_the_rings, silmarillion, clean_code ] | |
#--select |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ALL? ANY? | |
Book = Struct.new(:title, :author, :status) | |
lord_of_the_rings = Book.new('Lord of the Rings', 'Tolkien', :read) | |
silmarillion = Book.new('Silmarillion', 'Tolkien', :read) | |
clean_code = Book.new('Clean code', 'Martin', :read) | |
books = [ lord_of_the_rings, silmarillion, clean_code ] | |
#--all? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import i18next from "i18next"; | |
import locales from "./locales"; | |
class Locales { | |
static init() { | |
i18next.init( | |
{ | |
lng: "en", | |
debug: false, | |
resources: locales, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function callAll(...fns) { | |
return (...args) => { | |
fns.forEach(fn => { | |
fn && fn(...args) | |
}) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fetchMock = (url, suffix = "") => ( | |
new Promise((resolve) => ( | |
setTimeout(() => { | |
resolve({ | |
json: () => ( | |
Promise.resolve({ | |
data: url + suffix, | |
}), | |
) | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*, *::before, &::after { | |
margin: 0; | |
padding: 0; | |
font-family: $font-body; | |
color: $color-text-primary; | |
box-sizing: border-box; | |
-webkit-font-smoothing: antialiased; | |
-moz-osx-font-smoothing: grayscale; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { constants } from "utils"; | |
export const emailValidator = (text) => ({ | |
isValid: constants.regex.email.test(text), | |
}); | |
export const passwordValidator = (text) => ({ | |
isValid: constants.regex.password.test(text), | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import i18next from "i18next"; | |
import locales from "./locales"; | |
class Locales { | |
static init() { | |
i18next.init( | |
{ | |
lng: "en", | |
debug: false, | |
resources: locales, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "\n================================\n" | |
echo "Starting build \n" | |
yarn build | |
echo "Build finished \n" | |
echo "\n================================\n" | |
echo "\n================================\n" | |
echo "Startin upload \n" | |
aws s3 cp ./build/ s3://todoardo --recursive --acl public-read | |
echo "Upload finished \n" | |
echo "\n================================\n" |
NewerOlder