Skip to content

Instantly share code, notes, and snippets.

@technomorph
technomorph / XCode Auto @property -> @synthesize With Search Replace
Last active February 3, 2022 05:02
Use Reg-Ex Search and Replace to help create @synthesize out of your already typed Interface @Property
In XCode always finding it hassle to continuouly enter @synthesize for @properties already entered.
I Came Up with a RegEx to help me.
I copy the properties from the .h page and paste them in the .m
IE:
#pragma mark TAGS2 INFO HELP
@property (nonatomic) NSString* tags2Help;
@property (nonatomic) IBOutlet NSTextField* tags2HelpTF;
@technomorph
technomorph / fuzzyregex.js
Created July 9, 2020 17:23 — forked from samknight/fuzzyregex.js
Fuzzy Regex match
// This will allow unordered search terms to match relevant string
// e.g. Really Long String will be matched by
// - long string
// - long really
// - all ring
// ..etc
// I have used this anonymous function to override the matcher function in select2
function(term, text) {
@technomorph
technomorph / spotify-to-itunes-playlists.rb
Created June 29, 2020 08:21 — forked from cheshire137/spotify-to-itunes-playlists.rb
Ruby script to create iTunes playlists from your Spotify playlists. Requires a Spotify API app.
#!/usr/bin/env ruby
require 'uri'
require 'json'
require 'net/https'
require 'time'
require 'cgi'
require 'csv'
# You need a Spotify API app to have a client ID and client secret. Create
# one at https://developer.spotify.com/my-applications/#!/applications/create
@technomorph
technomorph / gist:cbee7a3487100c8a67b36068a800d054
Created June 29, 2020 08:12 — forked from atomicules/gist:884922
iTunes Script - Add Wishlist Item. Note that this information is probably out of date. It is being added here for reference/archival purposes and relates to a blog post from 2005
-- This script uses a dummy mp3 file (not supplied) to add a wishlist item to a specified playlist in your library.
-- Useful for when the track isn't available from the iTMS (and hence you can't drag this in as a wishlist item) and you want to remember to acquire it later from 'other sources'. You can use the dummy track in a playlist to act as a placeholder until you obtain it. I.e. to layout a running order, etc.
--
-- HOW TO USE
--
-- Use Quicktime to create a dummy mp3 file. Open a new player and just save as to create a mp3.
--Place the dummy file somewhere suitable, amend the path below
--Amend the wishlist playlist name if so desired
--This script (last time I checked) worked better when complied as an application, otherwise some Apple Event time out errors occur with the dialogs sometimes
--The script will prompt for a name, artist and album when run.
@technomorph
technomorph / itunes_dedupe.applescript
Created June 29, 2020 07:58 — forked from ryjen/itunes_dedupe.applescript
Finds duplicate songs in a selection in itunes
-- Author: Ryan Jennings <[email protected]>
-- Date: Aug 2, 2019
-- Description:
-- Finds duplicate songs in a selection in itunes
-- Ranked meta data is:
-- 1. song name
-- 2. artist
-- 3. bitrate (ex 320 over 256)
-- 4. duration (ex keep 12:00 as too different from 4:40, but discard 3:50)
@technomorph
technomorph / Playlist2Comment.scpt
Created June 29, 2020 07:51 — forked from mikan-megane/Playlist2Comment.scpt
プレイリスト名をコメントに入れる奴 var2.0
// 言語をjavascriptへ切り替えてご使用下さい
var app = Application.currentApplication()
app.includeStandardAdditions = true
// プレイリストのフォルダ情報を返す
function getParentPlaylist(playlist){
try{
return getParentPlaylist(playlist.parent()) + playlist.parent().name() + "/"
}catch(e){
(*This is the AppleScript component to the iTunes -> Spotify playlist sync program
Written by Sophie Li: 12/29/16*)
try
tell application "Finder"
delete (every item of folder (((path to home folder) as text) & "Scripts:playlist_sync:playlists") whose name ends with ".xml")
end tell
on error errMsg number errNum
display dialog "Error " & errNum & return & return & errMsg buttons {"Cancel"} default button 1
end try

Videos

@technomorph
technomorph / example.applescript
Created January 2, 2019 11:16 — forked from pudquick/example.applescript
Example AppleScriptObjC / Cocoa-Applescript function for parsing hdiutil mount plist output via ObjC calls
script AppDelegate
property parent: class "NSObject"
-- Syntax sugar
property myApp: current application
property None: missing value -- Be careful not to bind this as a IBOutlet!
-- Classes
property NSData: myApp's class "NSData"
property NSString: myApp's class "NSString"