Skip to content

Instantly share code, notes, and snippets.

View tarcisiozf's full-sized avatar

Tarcísio Zotelli Ferraz tarcisiozf

View GitHub Profile
@tarcisiozf
tarcisiozf / enigma.js
Created February 24, 2017 15:58
ENIGMA
'use strict';
Array.prototype.clone = function() {
return this.slice(0);
}
class Enigma {
constructor() {
@tarcisiozf
tarcisiozf / php.ini
Last active June 14, 2018 18:59
PHP XDEBUG
[XDebug]
zend_extension = "/usr/lib/php/20160303/xdebug.so"
xdebug.remote_host = "localhost"
xdebug.remote_autostart = "On"
xdebug.remote_enable = "On"
xdebug.remote_port = 9000
xdebug.remote_mode = req
xdebug.remote_handler=dbgp
xdebug.trace_output_dir = "/var/log/xdebug/"
xdebug.idekey="xdebug"
@tarcisiozf
tarcisiozf / mkcd.sh
Created July 3, 2018 16:24
mkcd utils
alias mkcd='function _mkcd(){ mkdir -p "$1" && cd "$1"; };_mkcd'
@tarcisiozf
tarcisiozf / ccdup.sh
Created July 18, 2019 18:01
count duplicated lines
alias count-duplicates='function _ccdup(){ sort $1 | uniq -c | sort -nr; };_ccdup'
@tarcisiozf
tarcisiozf / playlist.js
Created September 15, 2020 12:51
calculate youtube playlist duration
MINUTE = 60
HOUR = 60 * MINUTE
DAY = 24 * HOUR
timeToSeconds = (time) => {
let base = 1
return time.split(':')
.reverse()
.map(Number)
.reduce((acc, val) =>
@tarcisiozf
tarcisiozf / Price-Time Matching Engine.c
Last active October 5, 2020 13:31 — forked from Jud/Price-Time Matching Engine.c
Price-Time Matching Engine
/*****************************************************************************
* QuantCup 1: Price-Time Matching Engine
*
* Submitted by: voyager
*
* Design Overview:
* In this implementation, the limit order book is represented using
* a flat linear array (pricePoints), indexed by the numeric price value.
* Each entry in this array corresponds to a specific price point and holds
* an instance of struct pricePoint. This data structure maintains a list
@tarcisiozf
tarcisiozf / download-m3u8.sh
Created November 24, 2020 21:44
Video Utils
#!/bin/bash
VIDEO_ADDRESS=$1
OUTPUT_FILE=$2
ffmpeg -i "${VIDEO_ADDRESS}" -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 "${OUTPUT_FILE}"
@tarcisiozf
tarcisiozf / SEGFAULT.md
Last active October 29, 2021 15:40
Error handling
@tarcisiozf
tarcisiozf / guide.md
Last active June 17, 2021 19:12
Webstorm > Settings > Build, Execution, Deployment > Debugger > Stepping
  • Always do smart step into
  • Do not step into library scripts
  • Do not step into scripts:
  • /home/<USER>/.config/JetBrains/WebStorm2021.1/javascript/nodejs/**
  • node:internal/*
  • /**
@tarcisiozf
tarcisiozf / app.js
Last active August 16, 2021 23:17
easier dom components in js (without jsx), inspired by h
const { ul, li } = require('./html')
const list = ul({ title: 'awesome list' },
li({ title: 'interactive', onclick: () => alert(1) }, 'first'),
li('second')
)
document.body.appendChild(list)