Skip to content

Instantly share code, notes, and snippets.

View Wilsonilo's full-sized avatar
🥷
Working from home

Wilson Muñoz Wilsonilo

🥷
Working from home
View GitHub Profile
@Wilsonilo
Wilsonilo / wezterm.lua
Created August 24, 2024 18:27
Just my Wezterm config, dirty, I ned to clean it up
-- Import the wezterm module
local wezterm = require("wezterm")
-- Session management
local session_manager = require("wezterm-session-manager/session-manager")
wezterm.on("save_session", function(window) session_manager.save_state(window) end)
wezterm.on("load_session", function(window) session_manager.load_state(window) end)
wezterm.on("restore_session", function(window) session_manager.restore_state(window) end)
-- Creates a config object which we will be adding our config to
@Wilsonilo
Wilsonilo / screenshots_png_to_jpg.sh
Created May 21, 2021 15:12
Convert PNG Screenshots to JPG
#!/bin/bash
#Remember to give +x with chmod.
#Rename in case there is space
#https://stackoverflow.com/questions/1806868/linux-replacing-spaces-in-the-file-names
for file in *; do mv "$file" `echo $file | tr ' ' '_'` ; done
#convert to jpg
#https://www.cisdem.com/resource/png-to-jpg-mac.html
for i in *.png;do sips -s format jpeg $i --out ./$i.jpg;done;
@Wilsonilo
Wilsonilo / ip_address_and_mac.sh
Created April 24, 2021 01:20
Small bash script to get IP and MAC Address on MAC.
#!/usr/bin/env bash
#Original source: https://apple.stackexchange.com/questions/20547/how-do-i-find-my-ip-address-from-the-command-line
#I just added the MAC address.
dumpIpForInterface()
{
IT=$(ifconfig "$1")
if [[ "$IT" != *"status: active"* ]]; then
return
fi
if [[ "$IT" != *" broadcast "* ]]; then
@Wilsonilo
Wilsonilo / HstackDragDrop.swift
Last active November 2, 2022 01:14
Drag and Drop SwiftUI with ScrollView and HStack
//: HSTack /Scroll View With Drag and Drop
// By Wilson Munoz / @yosoywil
// Inspiration 1: https://gist.github.com/tarasis/f9bac6d98de5433f1ddbadaef02f9a29
// Inspiration 2: https://swiftui-lab.com/drag-drop-with-swiftui/
// Really dirty but functional, need to stress test with several items in the ScrollView/HStack and check memory.
import SwiftUI
import PlaygroundSupport
import Combine
@Wilsonilo
Wilsonilo / gitignore xcode
Created August 8, 2019 23:02
Personal gitignore
# Xcode
# Remeber to clean cache.
# git rm -r --cached .
# git add .
# git commit -am 'git cache cleared'
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
## Build generated
build/
DerivedData
@Wilsonilo
Wilsonilo / LoaderUIView.swift
Created October 23, 2018 23:04
Loader Animation With CAShapeLayer and CABasicAnimation
//
// LoaderUIView.swift
//
// Created by Wilson Munoz on 10/23/18.
// @yosoywil
// Based on documentation from:
// https://www.youtube.com/watch?v=O3ltwjDJaMk
// https://www.raywenderlich.com/449-how-to-implement-a-circular-image-loader-animation-with-cashapelayer
import UIKit
@Wilsonilo
Wilsonilo / .zprofile
Last active January 5, 2018 15:38
Just a simple profile and bash aliases that i like to use.
echo ""
echo " _/ _/ _/ _/ "
echo " _/ _/ _/_/ _/_/ "
echo " _/ _/ _/ _/ _/ _/ "
echo " _/ _/ _/ _/ _/ "
echo " _/ _/ _/ _/ "
echo "\n\n"
echo -n "Today: "; date "+%d-%m-%Y %H:%M:%S"
# Parser for directorio.txt
# (Structure: line 1: name, line2: address, line3: phone (opt) or email (opt) or website (opt) or category/material)
# Author: Wilson Munoz
# www.wilsonmunoz.net
# Tried to follow https://www.python.org/dev/peps/pep-0008/ sorry if something is not good.
import os
import sys
import re
import json

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: