Skip to content

Instantly share code, notes, and snippets.

View jlehikoinen's full-sized avatar
🍏
Digesting WWDC23

Janne Lehikoinen jlehikoinen

🍏
Digesting WWDC23
View GitHub Profile
@jlehikoinen
jlehikoinen / gist:ce8858e328636c39a958bcf8b1a83395
Last active April 8, 2020 08:33
Codesign macOS Installer package
# Automator > Quick Action
# Workflow receives current "files or folders" in "Finder"
# Add "Run Shell Script" action
# Copy script below to "Run Shell Script" window
# Replace <codesigning certificate> at row 28 with your certificate information
# Save quick action as: "Sign Installer package"
# Quick Actions live in: ~/Library/Services
# Receives files and folders
@jlehikoinen
jlehikoinen / gist:ec7bbf5d7a5696b3761df881fac4571f
Last active June 9, 2021 18:42
Codesign Configuration Profile
# Automator > Quick Action
# Workflow receives current "files or folders" in "Finder"
# Add "Run Shell Script" action
# Copy script below to "Run Shell Script" window
# Replace <codesigning certificate> at row 28 with your preferred certificate
# Save quick action as: "Sign Configuration Profile"
# Quick Actions live in: ~/Library/Services
# Receives files and folders
@jlehikoinen
jlehikoinen / create_xcode_icns.sh
Created August 29, 2019 06:33
Create Xcode iconset for macOS app from a 1024x1024 sized png file
#!/bin/sh
# ================================================
# create_xcode_icns.sh
#
# Create Xcode iconset for macOS app from a 1024x1024 sized png file
#
# Drag png file to Terminal window to get the file path as a parameter for the script
# Iconset will be created to the same folder where the original icon is
# Import (drag&drop) icns file to Xcode
@jlehikoinen
jlehikoinen / gist:28ec2336f82110829868931543b4ed95
Last active January 17, 2024 06:47
Remove signature from Configuration Profile using Quick Action
# Automator > Quick Action
# Workflow receives current "files or folders" in "Finder"
# Add "Run Shell Script" action
# Copy script below to "Run Shell Script" window
# Replace <text-editor-app> at row 36 with your preferred text editor app
# Save quick action as: "Remove signature from Profile & open in <app>"
# Quick Actions live in: ~/Library/Services
# Target folder
@jlehikoinen
jlehikoinen / set_outlook_as_default_application.py
Last active August 17, 2017 06:43
Set MS Outlook as default email application in macOS
#!/usr/bin/python
"""
set_outlook_as_default_application.py
Description:
Set Outlook as a default application for email, calendar and contacts
"""
@jlehikoinen
jlehikoinen / set_default_application_for_filetype.py
Last active June 30, 2017 03:56
Set default application for a file type in macOS
#!/usr/bin/python
"""
set_default_application_for_filetype.py
Description:
Set default application for a file type in macOS
"""
@jlehikoinen
jlehikoinen / clean_up_infected_handbrake.sh
Last active May 9, 2017 00:08
Clean up infected HandBrake (1.0.7) for macOS
#!/bin/sh
###
# Clean up infected HandBrake (1.0.7) for macOS
# Note that this script is WIP and does not remove all the traces of the malware
# e.g. reverting /etc/sudoers back to previous state is left out here
# Based on the information posted here:
@jlehikoinen
jlehikoinen / remove_admin_rights.py
Last active May 6, 2017 05:59
Remove admin rights in macOS
#!/usr/bin/python
"""
# Beef:
/usr/bin/dscl -plist . -read /Groups/admin GroupMembership
/usr/sbin/dseditgroup -o edit -d <shortname> -t user admin
"""
"""
@jlehikoinen
jlehikoinen / setup.sh
Last active March 4, 2021 13:12
Swift syntax highlighting for Vim
# Swift syntax highlighting for Vim
# Source: http://wingsquare.com/blog/swift-script-syntax-highlighting-and-indentation-for-vim-text-editor/
echo "--- Installing and configuring Pathogen.."
mkdir -p ~/.vim/autoload ~/.vim/bundle
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
echo "execute pathogen#infect()
syntax on
"""
setup_example.py
Run this script from the Pythonista Documents root
Setup script for https://github.com/jlehikoinen/pythonista-flask-example
"""
import requests
import zipfile
import urllib
import tempfile