Mix.install([
{:liveview_playground, "~> 0.1.1"}
])
This file contains 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 -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | grep -oP 'sha256:[0-9a-f]*')" | |
# syntax = docker/dockerfile:1.4.0 | |
FROM node:20 | |
WORKDIR /root | |
RUN npm install sqlite3 |
This file contains 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
export default { | |
data () { | |
return { | |
xsMobileMedia: window.matchMedia('(max-width: 576px)'), | |
mobileMedia: window.matchMedia('(max-width: 1023px)'), | |
isXsMobile: false, | |
isMobile: false, | |
} | |
}, | |
methods: { |
This file contains 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 R = new LaRamda() | |
/** | |
* A subset of custom implementations of functions from | |
* the Ramda library. (all in Lamda form) | |
* - thanks to @xgrommx for uniq, intersection, where, evolve, | |
* applySpec, defaultTo, both, either, cond, zipWith | |
*/ | |
function LaRamda () { | |
const I = x => x |
This file contains 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
"use strict"; | |
const digits = num => num.toString().split("").map(Number); | |
const invertNumber = number => digits(number).reverse(); | |
const toNumber = list => Number(list.join("")); | |
const invertDigit = number => toNumber(invertNumber(number)); | |
const sumList = list => list.reduce((pre, curr) => pre + curr); | |
const sumDigits = number => sumList(digits(number)); | |
This file contains 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
/* OBMEP 2015 - 2ª Fase - Data */ | |
function sum_digit(number) { | |
var result = 0; | |
while (number) { | |
result += number % 10; | |
number = Math.floor(number / 10); | |
} | |
return result; | |
} |
This file contains 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 matrix = [[2,4,6,8],[12,14,16,18],[20,24,28,32],[32,34,36,38],[42,44,46,48]]; | |
const exp = matrix[0]; | |
const arrNumbers = matrix.slice(1); | |
const props = [ | |
(number, _i) => (number * exp[_i]), | |
(number, _i) => (number / exp[_i]), | |
(number, _i) => (number - exp[_i]), | |
(number, _i) => (number + exp[_i]) | |
]; | |
const op = (arr, _i) => arr.map(_a => props[_i](_a, _i)); |
This file contains 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
"use strict"; | |
const arr = [[-1, 3, 4, 1], [2, 2, 4, 9], [4, 5, -7, 9]]; | |
const flatten = [].concat(...arr); | |
const find = () => flatten.filter(_a => _a < 0).length; | |
console.log(find()) //2 |
This file contains 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
/* | |
* Count Negative Integers in Matrix | |
*/ | |
M = [ | |
[ -1, 3, 4, 1], | |
[ 2, 2, 4, 9], | |
[ 4, 5, -7, 9] | |
] |
NewerOlder