Skip to content

Instantly share code, notes, and snippets.

View tonilopezmr's full-sized avatar

Antonio López Marín tonilopezmr

View GitHub Profile
#!/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
@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() {
class Sender {
fun send(send: Send, message: String, to: String) {
send.send(to, message)
}
}
interface Send {
fun send(to: String, message: String)
@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
//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 {