Skip to content

Instantly share code, notes, and snippets.

View tonilopezmr's full-sized avatar

Toni Lopez tonilopezmr

View GitHub Profile
//Challenge https://github.com/jesus-seijas-sp/hand-challenge
// Command: node script.js input.hand
let helloworld = "πŸ‘‰πŸ‘†πŸ‘†πŸ‘†πŸ‘†πŸ‘†πŸ‘†πŸ‘†πŸ‘†πŸ€œπŸ‘‡πŸ‘ˆπŸ‘†πŸ‘†πŸ‘†πŸ‘†πŸ‘†πŸ‘†πŸ‘†πŸ‘†πŸ‘†πŸ‘‰πŸ€›πŸ‘ˆπŸ‘ŠπŸ‘‰πŸ‘‰πŸ‘†πŸ‘‰πŸ‘‡πŸ€œπŸ‘†πŸ€›πŸ‘†πŸ‘†πŸ‘‰πŸ‘†πŸ‘†πŸ‘‰πŸ‘†πŸ‘†πŸ‘†πŸ€œπŸ‘‰πŸ€œπŸ‘‡πŸ‘‰πŸ‘†πŸ‘†πŸ‘†πŸ‘ˆπŸ‘ˆπŸ‘†πŸ‘†πŸ‘†πŸ‘‰πŸ€›πŸ‘ˆπŸ‘ˆπŸ€›πŸ‘‰πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘ŠπŸ‘‰πŸ‘‡πŸ‘‰πŸ‘†πŸ‘†πŸ‘†πŸ‘ŠπŸ‘ŠπŸ‘†πŸ‘†πŸ‘†πŸ‘ŠπŸ‘‰πŸ‘‡πŸ‘ŠπŸ‘ˆπŸ‘ˆπŸ‘†πŸ€œπŸ‘‰πŸ€œπŸ‘†πŸ‘‰πŸ‘†πŸ€›πŸ‘‰πŸ‘‰πŸ€›πŸ‘ˆπŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘ŠπŸ‘‰πŸ‘‰πŸ‘ŠπŸ‘†πŸ‘†πŸ‘†πŸ‘ŠπŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘ŠπŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘ŠπŸ‘‰πŸ‘†πŸ‘ŠπŸ‘‰πŸ‘†πŸ‘Š"
const fs = require('fs')
var input = Array.from(helloworld)
try {
@tonilopezmr
tonilopezmr / pre-commit-ktlint
Last active August 15, 2021 10:05
Pre-commit hook to run ktlint with auto-correct option and it adds the auto-correct changes into the commit.
#!/bin/sh
# https://github.com/shyiko/ktlint pre-commit hook
git diff --name-only --cached --relative | grep '\.kt[s"]\?$' | xargs ktlint -F --relative .
if [ $? -ne 0 ]; then exit 1; else git add .; fi
class Sender {
fun send(send: Send, message: String, to: String) {
send.send(to, message)
}
}
interface Send {
fun send(to: String, message: String)
@tonilopezmr
tonilopezmr / build.gradle
Created September 25, 2016 11:32
Create auto VersionName and VersionCode
def computeVersionName() {
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'describe', '--abbrev=0', '--tags'
standardOutput = stdout
}
return stdout.toString().trim().replaceAll('v', '')
}
def computeVersionCode() {
#!/bin/sh
palette="/tmp/palette.png"
filters="fps=15,scale=540:-1:flags=lanczos"
ffmpeg -v warning -i $1 -vf "$filters,palettegen" -y $palette
ffmpeg -v warning -i $1 -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y $2