Skip to content

Instantly share code, notes, and snippets.

View robotsandcake's full-sized avatar
💭
Groovy

Stuart robotsandcake

💭
Groovy
View GitHub Profile
@robotsandcake
robotsandcake / jemoji.md
Last active June 15, 2020 21:19 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
delay 10
-- Change the disk name to your Volume name.
set diskName to "Music"
tell application "System Events" to set diskNames to name of every disk
if diskName is in diskNames then
display dialog quoted form of diskName & " is already mounted." & return buttons {"OK"} default button 1
else
-- Change the credentials and olume location to suit your needs.
mount volume "afp://username:password@volume.local/Music"
end if
#!/bin/bash
echo open -a /Users/yourusername/bin/KeepVolumeConnected/ConnectToNetworkDrive.app | /bin/bash
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>wakestora</string>
@robotsandcake
robotsandcake / custom-customise.yml
Last active January 19, 2018 01:28
This code will generate a customised customise.yaml file when put in the developer section of homeassistant
{% for state in states.sensor -%}
{% if loop.first %}
{% elif loop.last %}
{% else %}
{% endif %}
{{- state.entity_id }}:
friendly_name: '{{ state.attributes.friendly_name|replace("_"," ",)|title() if state.attributes.friendly_name is defined else state.name|replace("_"," ",)|title() }}'
emulated_hue: {{state.attributes.emulated_hue if state.attributes.emulated_hue is defined else 'False' }}
hidden: {{state.attributes.hidden if state.attributes.hidden is defined else "False"}}
{{'icon: '+ state.attributes.icon if state.attributes.icon is defined}}
@robotsandcake
robotsandcake / .DS_Store
Last active March 24, 2017 19:01
This bash script will take a folder full of PNG and JPEG files, convert them into various sizes and place them into different folders based on size.
@robotsandcake
robotsandcake / resize-with-sips.sh
Last active March 24, 2017 18:57
This bash script will take a folder full of PNG and JPEG files, convert them into various sizes and place them into different folders based on size.
#!/bin/bash
# This work is licensed under the WTFPL.
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# Version 2, December 2004
# Copyright (C) 2017 Stuart Turner <contact@escapologybb.com>
# Everyone is permitted to copy and distribute verbatim or modified
# copies of this license document, and changing it is allowed as long
@robotsandcake
robotsandcake / screen-share.sh
Last active June 19, 2018 19:29
This bash script enables you to Screen Share with a remote machine using Apple's built-in screen sharing tools.
#!/bin/bash
# This will open Apple's Screen Sharing tool and connect to the desired machine
# Replace the username and password with the details of the remote machine you wish to connect to
# That goes for the IP address as well.
# Usage #
# Make the script executable with "chmod +x screen-share.sh" and then run it with:
# "./screen-share.sh
@robotsandcake
robotsandcake / play-pause-itunes.scpt
Last active April 4, 2017 10:05
This AppleScript will toggle the iTunes player on macOS between two states, play and pause. It can be triggered from any application that can trigger AppleScripts.
try
-- Specify the application will want to work on, in this case iTunes.
tell application "iTunes"
-- Get iTunes current state
if player state is paused then
-- If iTunes is paused, press play.
play
-- Get iTunes state if it doesn't match the first condition
else if player state is playing then
-- If iTunes is playing, press pause.
@robotsandcake
robotsandcake / itunes-play-pause.applescript
Created May 14, 2017 10:01
This AppleScript when used in conjunction with DragonDictate for Mac will play/pause the current iTunes track.
try
-- Specify the application will want to work on, in this case iTunes.
tell application "iTunes"
-- Get iTunes current state
if player state is paused then
-- If iTunes is paused, press play.
play
-- Get iTunes state if it doesn't match the first condition
else if player state is playing then
-- If iTunes is playing, press pause.