Skip to content

Instantly share code, notes, and snippets.

View xenatt's full-sized avatar

Nattapong Pullkhow xenatt

View GitHub Profile
-- base on
-- TweetViaTweetbot.applescript
-- Copy title and URL in the front most window of Safari to Tweetbot with link
-- Author: Romain Briche
tell application "System Events"
if not (exists application process "Tweetdeck") then
tell application "TweetDeck" to activate
end if
if not (exists application process "iTunes") then
-- base on
-- TweetViaTweetbot.applescript
-- Copy title and URL in the front most window of Safari to Tweetbot with link
-- Author: Romain Briche
tell application "System Events"
if not (exists application process "Twitterrific") then
tell application "Twitterrific" to activate
end if
if not (exists application process "iTunes") then
-- base on
-- TweetViaTweetbot.applescript
-- Copy title and URL in the front most window of Safari to Tweetbot with link
-- Author: Romain Briche
tell application "System Events"
if not (exists application process "Janetter") then
tell application "Janetter" to activate
end if
if not (exists application process "iTunes") then
@xenatt
xenatt / iTunes_Geeklets.sh
Last active December 16, 2015 18:38
Shell script for iTunes Player status and Cover Geeklets Download http://xenatt.deviantart.com/art/MINIMAL-GEEKLETS-366032600
itnsps=`osascript -e "tell application \"System Events\"" -e "if (exists application process \"iTunes\") then" -e "return \"yes\"" -e "else" -e "return \"no\"" -e "end if" -e "end tell"`
lasttrack=`tail /tmp/itunestrack`
if [ "$itnsps" = "yes" ]
then
itnsplst=`osascript -e "tell application \"iTunes\"" -e "return (get player state as string)" -e "end tell"`
if [ "$itnsplst" = "playing" ]
then
on searchencode(theText)
set AppleScript's text item delimiters to " "
set theTextItems to text items of theText
set AppleScript's text item delimiters to "+"
set theText to theTextItems as string
set AppleScript's text item delimiters to {""}
set AppleScript's text item delimiters to "%0A"
set theTextItems to text items of theText
set AppleScript's text item delimiters to ""
set theText to theTextItems as string
display dialog "Tweet?" default answer "" buttons {"OK"} default button 1
set mytweet to text returned of result
tell application "System Events"
tell process "Notification Center"
click menu bar item 1 of menu bar 1
click button 1 of UI element 1 of row 2 of table 1 of scroll area 1 of window "window"
keystroke mytweet
keystroke "D" using {command down, shift down}
keystroke space
@xenatt
xenatt / iNVRAMPatch
Created July 28, 2013 05:06
This Shell script Use GPL (GNU GENERAL PUBLIC LICENSE)
echo "Start Patch iCloud Service .............."
sudo cat > /Library/LaunchDaemons/com.nvram.root.plist << EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.nvram.root</string>
<key>ProgramArguments</key>
<array>
# Maintained by: xenatt for: Gigabyte Z77P-D3at: Mon Dec 30 16:01:49 UTC 2013
# Patch Name : GA-Z77P-D3
# Note : base on PJALM Gigabyte General z77 patch
# Add the DTGP method
into method label DTGP remove_entry;
into definitionblock code_regex . insert begin
Method (DTGP, 5, NotSerialized)\n
{\n
If (LEqual (Arg0, Buffer (0x10)\n
@xenatt
xenatt / .maciasl
Last active January 3, 2016 08:19
GIGABYTE Z77P-D3 DSDT https://gist.github.com/xenatt/8435723/raw/f16bd30b76f655e5fc48d53b3541255612ce261b/Z77P-D3.txt