Skip to content

Instantly share code, notes, and snippets.

View illescasDaniel's full-sized avatar
💻
Learning something new

Daniel Illescas Romero illescasDaniel

💻
Learning something new
View GitHub Profile
@illescasDaniel
illescasDaniel / alacritty.yml
Last active November 3, 2020 12:14
~/.config/alacritty/alacritty.yml config file
# Configuration for Alacritty, the GPU enhanced terminal emulator
# Any items in the `env` entry below will be added as
# environment variables. Some entries may override variables
# set by alacritty it self.
env:
# TERM env customization.
#
# If this property is not set, alacritty will set it to xterm-256color.
#
@illescasDaniel
illescasDaniel / .zshrc
Last active November 26, 2020 19:38
zsh config
cat ~/.cache/neofetch
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
## Options section
@illescasDaniel
illescasDaniel / init.vim
Last active November 26, 2020 19:39
My neovim config ~/.config/nvim/init.vim
" ######################## Vim-plug plugins ########################
" $HOME/.local/share/nvim/plugged
call plug#begin(stdpath('data') . '/plugged')
" Theming
" Plug 'itchyny/lightline.vim'
Plug 'vim-airline/vim-airline'
"Plug 'vim-airline/vim-airline-themes'
Plug 'morhetz/gruvbox'
Plug 'joshdick/onedark.vim'
Plug 'KeitaNakamura/neodark.vim' " Good for Ruby
@illescasDaniel
illescasDaniel / CountDownTimer.swift
Last active August 19, 2020 14:03
Swift countdown timer
// MIT License
import Foundation
class CountdownTimer {
struct ClockTime {
let hours: Int
let minutes: Int
let seconds: Int
@illescasDaniel
illescasDaniel / shell_aliases.zsh
Last active July 17, 2020 16:42
Some shell aliases
alias d-list="exa --long --all --header --git --classify"
alias d-listv="exa --long --header --git --classify"
alias d-list-trash="gio list -lh trash://"
alias d-open="gio open"
alias d-show="batcat"
alias d-edit="micro"
alias d-copy="gio copy --progress --interactive"
alias d-copyb="d-copy --backup"
alias d-move="gio move --progress --interactive"
alias d-moveb="d-move --backup"
@illescasDaniel
illescasDaniel / must_have_linux.sh
Last active July 24, 2020 21:06
Must have packages (linux (apt))
#!/bin/sh
echo "-> Running apt update and upgrade"
apt update
apt -y upgrade
# Basic
echo "-> Installing basic stuff"
apt install -y curl # Curl
apt install -y wget # Wget
@illescasDaniel
illescasDaniel / ThreadManager.swift
Created June 30, 2020 07:53
Simple thread manager
import Foundation
struct Queue<T> {
private var values: [T]
init(values: [T] = []) {
self.values = values
}
@illescasDaniel
illescasDaniel / sorted-diacritic-insensitive.swift
Last active June 9, 2020 12:00
Sort strings ignoring diacritics
import Foundation
let names = [
"camión",
"camiones",
"camizn"
]
// Better version !
@illescasDaniel
illescasDaniel / DispatchGroup-await.swift
Created March 30, 2020 15:35
Some convenient methods for Dispatch group to synchronize async function calls - very useful for testing
extension DispatchGroup {
typealias Callback<T> = (T) -> Void
typealias ClosureCallback<T> = Callback<Callback<T>>
enum AwaitError: Error {
case timeout
case nilValue
}
class RoundImageView: UIImageView {
override func layoutSubviews() {
super.layoutSubviews()
imageView.layer.shadowColor = UIColor.black.cgColor
imageView.layer.shadowOpacity = 1
let shadowRadius: CGFloat = 8
imageView.layer.shadowRadius = shadowRadius
imageView.layer.shadowOffset = .zero
imageView.frame = imageView.frame.inset(by: UIEdgeInsets(top: shadowRadius, left: shadowRadius, bottom: shadowRadius, right: shadowRadius))
imageView.layer.cornerRadius = self.frame.width / 2// asssuming the aspect ratio is 1:1