Skip to content

Instantly share code, notes, and snippets.

View dbonates's full-sized avatar
🏠
Working from home

Daniel Bonates dbonates

🏠
Working from home
  • Self Industry
  • Florianopolis, Brazil
View GitHub Profile
@dbonates
dbonates / pcat.sh
Last active December 17, 2022 04:05
pcat install, because cat should be pretty! 🐱
################
### macOS ###
################
brew install python3
brew install python
brew unlink python && brew link --overwrite python # make sure python links to python2
pip2 install --upgrade pip setuptools # upgrade to latest pip2
pip3 install --upgrade pip setuptools # upgrade to latest pip3
@dbonates
dbonates / truecolor-test.sh
Last active May 28, 2019 20:22
this helped me to detect tmux not being able to work on truecolor mode ;)
awk 'BEGIN{
s="/\\/\\/\\/\\/\\"; s=s s s s s s s s;
for (colnum = 0; colnum<77; colnum++) {
r = 255-(colnum*255/76);
g = (colnum*510/76);
b = (colnum*255/76);
if (g>255) g = 510-g;
printf "\033[48;2;%d;%d;%dm", r,g,b;
printf "\033[38;2;%d;%d;%dm", 255-r,255-g,255-b;
printf "%s\033[0m", substr(s,colnum+1,1);
( ͡° ͜ʖ ͡°)
¯\_(ツ)_/¯
(▀ ͜͞ʖ▀)
ʕ•ᴥ•ʔ
(▀̿Ĺ̯▀̿ ̿)
(ง ͠° ͟ل͜ ͡°)ง
༼ つ ◕_◕ ༽つ
ಠ_ಠ
(づ。◕‿‿◕。)づ
( ͠° ͟ʖ ͡°)
@dbonates
dbonates / better-ls_alias.sh
Last active December 29, 2021 13:49
my favourite ls command options
alias ll='CLICOLOR_FORCE=1 ls -la -G | less -SEX'
@dbonates
dbonates / PaygroundPerformanceTest.swift
Created April 19, 2019 04:33
Payground code for Performance Test - using String subscript extension
import UIKit
import XCTest
// experimenting with strings
// remove string at given indexes
extension String {
// just a convenience method to visualize indexes
func printIndexes() {
import UIKit
import XCTest
// experimenting with strings
// remove string at given indexes
extension String {
// just a convenience method to visualize indexes
func printIndexes() {
@dbonates
dbonates / zalgo.json
Created April 18, 2019 01:20
Zalgo characters
{
"above": [
"\u030d",
"\u030e",
"\u0304",
"\u0305",
"\u033f",
"\u0311",
"\u0306",
"\u0310",
@dbonates
dbonates / zalgo.json
Created April 18, 2019 01:20
Zalgo characters
{
"above": [
"\u030d",
"\u030e",
"\u0304",
"\u0305",
"\u033f",
"\u0311",
"\u0306",
"\u0310",
@dbonates
dbonates / DataService-String.swift
Created April 16, 2019 20:34
example on how to get string from data response
//: `A tiny network, where a generic Resource can be used to load any type from the internet, as long it provides a parse for it.`
import UIKit
import PlaygroundSupport
PlaygroundPage.current.needsIndefiniteExecution = true
struct Resource<T> {
var request: URLRequest
var parse: (Data) -> T?
{
"code": 4001,
"message": "Campos inválidos",
"invalid_fields": [
{ "field_name": "address_name", "message": "O nome do endereço é obrigatório"},
{ "field_name": "phone_number", "message": "O campo Telefone deve possuir no máximo 15 caracteres"}
],
"response": []
}