Skip to content

Instantly share code, notes, and snippets.

View jmcerrejon's full-sized avatar
🏠
Working home

Jose Cerrejon jmcerrejon

🏠
Working home
View GitHub Profile
@jmcerrejon
jmcerrejon / shutdown.app
Created April 18, 2025 16:19
Close all apps that are currently open and shut down your Mac using the Automator script. Because I prefer to switch to a Mac and start from scratch 😉
on run {input, parameters}
tell application "System Events"
set appList to name of every application process where background only is false
end tell
repeat with appName in appList
try
do shell script "killall '" & appName & "'"
end try
end repeat
@jmcerrejon
jmcerrejon / reddit_python_news.py
Created November 9, 2024 18:34
Just output to console latest Python Reddit posts
from typing import List, Tuple
import requests
def get_reddit_posts(subreddit: str) -> List[Tuple[str, str]]:
url = f"https://www.reddit.com/r/{subreddit}/new.json"
headers = {"User-agent": "Mozilla/5.0"}
response = requests.get(url, headers=headers)
data = response.json()
@jmcerrejon
jmcerrejon / grammarly_macos_install.sh
Created November 8, 2024 07:53
This script automates the download/update and installation of Grammarly on macOS using curl
#!/bin/bash
#
# This script automates the download/update and installation of Grammarly on macOS using curl
# Author: Jose Cerrejon
# Email: ulysess_.at_gmail.com
# Version: 1.0.0
#
URL="https://download-mac.grammarly.com/Grammarly.dmg"
DMG_PATH="/tmp/Grammarly.dmg"
MOUNT_POINT="/Volumes/Grammarly"
@jmcerrejon
jmcerrejon / reinstall-vulkan-driver.sh
Last active March 21, 2024 06:02
reinstall_vulkan_driver.sh
#!/bin/bash
# This script was created by PiKISS (https://github.com/jmcerrejon/PiKISS).
# It reinstalls the Vulkan driver for Mesa.
# If you don't want to use it, please make sure you delete the file: /etc/apt/apt.conf.d/99reinstall-vulkan-driver-hook
function reinstall_vulkan_driver() {
readonly BUILD_MESA_VULKAN_DRIVER_DIR="$HOME/mesa_vulkan/build"
if [[ ! -d $BUILD_MESA_VULKAN_DRIVER_DIR ]]; then
echo "Vulkan driver not found. Exiting..."
@jmcerrejon
jmcerrejon / clean_volume.py
Created March 26, 2023 17:26
Clean macOS volumes for non mac OS
import subprocess
def main():
volumes = subprocess.run(['mount'], stdout=subprocess.PIPE).stdout.decode('utf-8').split('\n')
for volume in volumes:
if '/Volumes/' in volume and 'nodev' in volume:
volume_name = volume.split()[2]
clean_volume(f"{volume_name}/pelis" if os.path.isdir(f"{volume_name}/pelis") else f"{volume_name}")
@jmcerrejon
jmcerrejon / titanium_aliases.zsh
Created December 6, 2021 17:10
My Titaniun aliases
#!/bin/bash
export TITANIUM_SDK_PATH="$HOME/Library/Application Support/Titanium/mobilesdk/osx/"
export CURRENT_APPC_SDK
CURRENT_APPC_SDK=$(ls -t "$TITANIUM_SDK_PATH" | head -n 1)
export IPHONEUDID="XXX" # iPhone Simulator
export IPHONEREALID="XXX" # iPhone 11
export ANDROIDID="android" # Android 10 Google Pixel 3 - 4096 RAM - SDK 29
export ANDROIDREALID="XXX" # Real Android device
@jmcerrejon
jmcerrejon / install_node.sh
Created October 16, 2021 12:13
Just install Node.js on Debian. (Tested on Raspberry Pi OS).
#!/bin/bash
#
# Intall Node.js (all versions)
#
install_node() {
local NODE_VERSION
if which node >/dev/null; then
read -p "Warning!: Node.js already installed (Version $(node -v)). Do you want to uninstall it (y/n)?: " option
case "$option" in
@jmcerrejon
jmcerrejon / repo_info.sh
Created April 27, 2021 16:45
Get repo info from GitHub
# brew install curl jq
# More info at: https://docs.github.com/en/rest/reference/repos#list-forks
repo_info() {
if [[ $1 == "" ]]; then
echo "Please, input a repo. Ex: jmcerrejon/pikiss"
return 0
fi
curl -H 'Accept: application/vnd.github.v3+json' \
"https://api.github.com/repos/$1/forks?sort=newest" | # sort = newest, oldest, or stargazers
jq '.[] | {name: .full_name, updated: .updated_at, stars: .stargazers_count}'
@jmcerrejon
jmcerrejon / backup.sh
Last active April 18, 2021 04:25
Zip the current Titanium project on macOS
#!/usr/bin/bash
#
# Description: Zip the current Titanium project on macOS
# File: backup.sh
# Author: Jose Cerrejon (ulysess_at_gmail.com)
# Help: Copy in the root of your Titanium project and Add to package.json the script: "backup": "sh backup.sh",
#
clear
stop_liveview() {
@jmcerrejon
jmcerrejon / index.js
Created December 30, 2020 10:50
Glass Morphic Maker concept for iOS using Axway Titanium
const win = Ti.UI.createWindow({
backgroundImage: '/images/background_bubles.png',
backgroundRepeat: false,
});
const lbTitle = Ti.UI.createLabel({
color: '#7C34C6',
font: {
fontSize: 32,
},