This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ /usr/libexec/PlistBuddy -c "Set :variables:server \"ABC-XYZ\"" info.plist |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$files = glob('images/*.*'); | |
$file = array_rand($files); | |
?> | |
<html> | |
<head> | |
<style type="text/css"> | |
body { | |
background-size: cover; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
property finderwindownumber : 1 | |
tell application "Finder" | |
set TotalNumberOfFinderWindows to (count of (every window where visible is true)) | |
if TotalNumberOfFinderWindows is greater than 0 then | |
tell application "Finder" | |
select window finderwindownumber | |
activate | |
set finderwindownumber to finderwindownumber + 1 | |
if finderwindownumber is greater than TotalNumberOfFinderWindows then | |
set finderwindownumber to 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php foreach($page->children() as $section): ?> | |
<h1><?php echo $section->title()->html() ?></h1> | |
<?php echo $section->text()->kirbytext() ?> | |
<?php endforeach ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Script to toggle ad-blocking on/off. Save in /usr/local/bin | |
# Source https://pi-hole.net/forums/topic/quickly-enabledisable-pi-hole-from-your-phone/ | |
# Toggle with $ pihole-toggle.sh | |
list=/etc/pihole/gravity.list | |
if [[ -f $list ]];then | |
mv $list $list.off |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
property soundsDirectory : POSIX file "/Users/digiltd/Dropbox/folder-full-of-sound-files/" as alias | |
tell application "System Events" to ¬ | |
set soundFile to get POSIX path of (some item of soundsDirectory as alias) | |
do shell script "afplay " & quoted form of soundFile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
Speaks the date and time of day | |
Copyright 2008 Apple Inc. All rights reserved. | |
You may incorporate this Apple sample code into your program(s) without | |
restriction. This Apple sample code has been provided "AS IS" and the | |
responsibility for its operation is yours. You are not permitted to | |
redistribute this Apple sample code as "Apple sample code" after having | |
made changes. If you're going to redistribute the code, we require |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "System Preferences" | |
activate | |
reveal pane "com.apple.preference.displays" | |
end tell | |
delay 0.5 | |
tell application "System Events" | |
tell process "System Preferences" | |
try --don't even consider not using a try block! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "System Events" to tell process "nvALT" | |
set p to value of text field 1 of group 1 of toolbar 1 of window 1 | |
set homeDir to (path to home folder from user domain as Unicode text) | |
-- replace "Dropbox:_SYNC:nValt:" with your notes folder and change ".markdown" if needed | |
set f to (homeDir & "Dropbox:_SYNC:nValt:" & p & ".markdown") as alias | |
end tell | |
tell application "Marked 2" | |
open f | |
activate | |
end tell |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set remotebuddy_list to {} | |
tell application "Tunnelblick" | |
set vpn_list to get name of configurations | |
end tell | |
repeat with i from 1 to count of vpn_list | |
set ind_configuration to item i of vpn_list | |
set end of remotebuddy_list to i | |
set end of remotebuddy_list to ind_configuration |