Skip to content

Instantly share code, notes, and snippets.

View danijeljw's full-sized avatar
🏠
Staying at home

Danijel-James Wynyard danijeljw

🏠
Staying at home
View GitHub Profile
@danijeljw
danijeljw / AlbumRatingReset.scpt
Created December 3, 2015 05:07 — forked from dhiraj/AlbumRatingReset.scpt
This AppleScript may allow you to remove or set the album rating on one or more of your tracks to a value you decide. If you use Smart Playlists based on the track rating field, this may be *the* AppleScript you were looking for. If not, then consider moving on, this is probably not what you were looking for. I've modified the script in this fil…
(*
"Album Rating Reset" for iTunes
written by Doug Adams
dougadams@mac.com
v1.0 sept 6 2007
-- initial release
v2.0 mar 6 2013
updated by Dhiraj Gupta (http://www.dhirajgupta.com)
@danijeljw
danijeljw / sdLRImportTool.sh
Last active March 2, 2021 15:52
Lightroom Image Import Prep v0.2
#!/bin/bash
# Lightroom Image Import Prep v0.2
todayDate="$(date +'%Y%m%d')"
sdCard=$"/Volumes/EOS_Digital/DCIM/100CANON/*"
newDir=$"$HOME/Desktop/$todayDate"
if [ -d "/$HOME/Desktop/$todayDate" ]; then
echo "Folder exists, manual import"
@danijeljw
danijeljw / remove_Office_2008.sh
Created March 11, 2014 06:02
Uninstall Microsoft Office 2008 Mac.
#!/bin/bash
echo
echo This will remove Office 2008 from your Mac
echo
echo
sleep 5
echo Removing Office from Applications
sudo rm -rf /Applications/Microsoft\ Office\ 2008
sleep 5
echo Removing Office Library files
@danijeljw
danijeljw / dock3d2d.sh
Created November 18, 2013 04:47
Bash script to change the Dock from 2D to 3D and vice-versa. Works in OS X 10.8.x and below.
#!/bin/bash
dock2d3d=$(defaults read com.apple.dock | grep "no-glass")
if [ $dock2d3d == "\"no=glass\" = 0;" ]
then
defaults write com.apple.dock no-glass -boolean YES && killall Dock
else
defaults write com.apple.dock no-glass -boolean NO && killall Dock
fi
tell application "System Events"
-- Careful of things we DON'T want to remove...
get the name of every login item
-- Check for both.
if login item "MacProtector" exists then
delete login item "MacProtector"
display dialog "Removed MacProtector from Login Items."
else
display dialog "No MacProtector infection found."
end if
@danijeljw
danijeljw / MacProtector.sh
Created October 30, 2013 08:33
MacDefender Removal Tool in Shell Script
#!/bin/sh
# MacProtector Removal Tool (Super-Simple) 1.0 - http://www.icrontic.com/
# (C) 2011 All Rights Reserved, Phillip R. Jaenke (phil@icrontic.com)
#
# LICENSE IS AS FOLLOWS:
# - This software is completely free to use or redistribute for personal use,
# HOWEVER:
# -- It must retain the above copyright notice and reference to Icrontic!
# - This software is completely free to use or redistribute for commercial use,
# HOWEVER:
@danijeljw
danijeljw / icndispdiag.applescript
Created October 26, 2013 08:34
AppleScript display dialog box with icon
Display dialog box with custom icon called _icon.icns_
```
display dialog "My custom icon " buttons {"Cancel", "Continue"} default button "Continue" with icon file "Contents:Resources:icon.icns"
```
```
set x to ((path to me as text) & "Contents:Resources:myicon.icn­s") as alias
display dialog "your text here" with icon x
```
@danijeljw
danijeljw / batVBdwnldr.bat
Created October 24, 2013 13:59
Use BATCH to download a file by creating then executing the VBScript
@echo off
rem Windows has no built-in wget or curl, so generate a VBS script to do it:
rem -------------------------------------------------------------------------
set DLOAD_SCRIPT=download.vbs
echo Option Explicit > %DLOAD_SCRIPT%
echo Dim args, http, fileSystem, adoStream, url, target, status >> %DLOAD_SCRIPT%
echo. >> %DLOAD_SCRIPT%
echo Set args = Wscript.Arguments >> %DLOAD_SCRIPT%
echo Set http = CreateObject("WinHttp.WinHttpRequest.5.1") >> %DLOAD_SCRIPT%
#!/bin/sh
# Detects which OS and if it is Linux then it will detect which Linux Distribution.
OS=`uname -s`
REV=`uname -r`
MACH=`uname -m`
GetVersionFromFile()
{
VERSION=`cat $1 | tr "\n" ' ' | sed s/.*VERSION.*=\ // `
@danijeljw
danijeljw / addmygit.sh
Created October 13, 2013 05:27
Install Git (req. cURL) on Linux in 1-step
#!/bin/bash
# Linux Auto-Install Git
#
# Copyright (c) 2012 Danijel James http://danijelj.com
#
# Licensed under MIT
# version number
version="1.0.5"