Skip to content

Instantly share code, notes, and snippets.

View atineoSE's full-sized avatar

Adrian Tineo atineoSE

View GitHub Profile

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:

@atineoSE
atineoSE / lightweight_waiting_API_for_XCUITests.swift
Last active March 12, 2020 14:39
Lightweight waiting API for XCUITests based on NSPredicate
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) {
@atineoSE
atineoSE / gist:c498a7d7891a22208723acc482fa2ac4
Created December 28, 2020 19:36
Simple python script to find a word in a list of sentences
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 / gist:c9be941d3ba87e7587478a80564f73c5
Created December 31, 2021 08:53
Stack trace from Mac crash
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 / gifenc.sh
Created June 18, 2022 11:00
Small script to generate animated gif
#!/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
@atineoSE
atineoSE / leaked-sys-prompts.md
Created March 8, 2024 10:39 — forked from cedrickchee/leaked-sys-prompts.md
Leaked System Prompts