Skip to content

Instantly share code, notes, and snippets.

Avatar

Adrian Tineo atineoSE

View GitHub Profile
@atineoSE
atineoSE / gifenc.sh
Created Jun 18, 2022
Small script to generate animated gif
View gifenc.sh
#!/bin/sh
# 1st param is input file, 2nd is output file, 3rd is framerate, 4th is width in pixel
palette="palette.png"
filters="fps=$3,scale=$4:-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
View gist:c9be941d3ba87e7587478a80564f73c5
CORE 0 recently retired instr at 0xfffffe0026d06b7c
CORE 1 recently retired instr at 0xfffffe0026d06b7c
CORE 2 recently retired instr at 0xfffffe0026d054b4
CORE 3 recently retired instr at 0xfffffe0026d06b7c
CORE 4 recently retired instr at 0xfffffe0026d06b80
CORE 5 recently retired instr at 0xfffffe0026d06b80
CORE 6 recently retired instr at 0xfffffe0026d06b80
CORE 7 recently retired instr at 0xfffffe0026d06b80
CORE 0 PVH locks held: None
CORE 1 PVH locks held: None
@atineoSE
atineoSE / gist:c498a7d7891a22208723acc482fa2ac4
Created Dec 28, 2020
Simple python script to find a word in a list of sentences
View gist:c498a7d7891a22208723acc482fa2ac4
def find_occurrences(phrasesList, text):
total_count = 0
for phrase in phrasesList:
local_count = 0
words = phrase.split()
for word in words:
if text in word:
local_count += 1
#print("Found {} ocurrences of \"{}\" in \"{}\"".format(local_count, text, phrase))
total_count += local_count
@atineoSE
atineoSE / lightweight_waiting_API_for_XCUITests.swift
Last active Mar 12, 2020
Lightweight waiting API for XCUITests based on NSPredicate
View lightweight_waiting_API_for_XCUITests.swift
let standardTimeout:Double = 10
let shortTimeout: Double = 5
//------ Definition
func wait(for object: Any, satisfying predicateFormat: String, errorMessage: String, fails: Bool = true, timeout:Double = standardTimeout, completion: (()->())? = nil) {
let predicate = NSPredicate(format: predicateFormat)
let expectation = XCTNSPredicateExpectation(predicate: predicate, object: object)
let result = XCTWaiter().wait(for: [expectation], timeout: timeout)
if (result != .completed) {
View keybase.md

Keybase proof

I hereby claim:

  • I am atineose on github.
  • I am atineose (https://keybase.io/atineose) on keybase.
  • I have a public key ASCZSEkg2dF6HAgriGXbcNpOI5IuMxfgj2jEDRGOhZaFbQo

To claim this, I am signing this object: