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
#!/bin/sh | |
# | |
# Clone secrets from one Fly app to another | |
TEMPFILE=`mktemp` | |
trap "rm -rf $TEMPFILE" EXIT | |
SECRET_KEYS=`fly secrets list -a $1 | tail -n +2 | cut -f1 -d" "` | |
fly ssh console -a $1 -C env | tr -d '\r' > $TEMPFILE |
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
// assets/js/app.js | |
// ... | |
import Pickr from "./pickr" | |
const hooks = { | |
Pickr | |
} | |
// ... |
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)); |
NewerOlder