working on it ...

Filters

Explore Public Snippets

Sort by

Found 30k snippets matching: mac

    public by lbottaro modified Nov 6, 2012  311365  3  6  0

    Get MAC address of current interface in Python

    This python uses uuid.getnode to get current mac address as an integer. It formats the number in a standard mac address form (i.e. bytes splitted by :)
    import uuid
    print ':'.join(['{:02x}'.format((uuid.getnode() >> i) & 0xff) for i in range(0,8*6,8)][::-1])
    

    public by fabio.nosenzo modified Jan 30, 2013  264110  8  6  0

    Refresh all pivot table excel vba macro

    With this snippet you can refresh all the pivot tables in excel workbook within a macro
    ThisWorkbook.RefreshAll

    public by jaehoon modified Aug 23, 2011  204785  1  4  0

    맥의 기본 한글 글꼴을 바꿔주는 스크립트 - A script for changing Mac OS X's default font fallbacks

    맥의 기본 한글 글꼴을 바꿔주는 스크립트 - A script for changing Mac OS X's default font fallbacks: MacOSXDefaultFontFallbacksChanger.command
    #!/usr/bin/env bash
    # A script for changing Mac OS X's default fonts
    # Author: Jaeho Shin <netj@sparcs.org>
    # Created: 2011-07-22
    
    ### MacOSXDefaultFontFallbacksChanger #########################################
    ## Mac OS X 기본 글꼴 설정 변경 도구 – 1.2.1 (2012-08)
    ##                    http://netj.github.com/MacOSXDefaultFontFallbacksChanger
    ###############################################################################
    
    # Specify sets of substitutions between these two lines of hashes:
    
    ### H: 함초롬 돋움 & 바탕 (한컴) ##############################################
    # Home: http://faq.ktug.or.kr/faq/%C7%D4%C3%CA%B7%D2%C3%BC/GSUB
    # Home: http://www.haansoft.com/hnc/event/ham/index.htm
    ## Download fonts from http://ftp.ktug.or.kr/KTUG/hcr-lvt/Hamchorom-LVT.zip
    ## Keep zip archive at ~/.fonts/HCR/Hamchorom-LVT.zip
    ## Change font AppleGothic=HCR Dotum LVT
    ## Change font AppleMyungjo=HCR Batang LVT
    ###############################################################################
    
    ### N: 나눔 고딕 & 명조 (네이버) ##############################################
    # Home: http://hangeul.naver.com/font
    ## Change font AppleGothic=Nanum Gothic
    ## Change font AppleMyungjo=Nanum Myeongjo
    ###############################################################################
    
    ### S: 산돌 고딕네오 & 나눔 명조 – 10.8+ 또는 산돌고딕네오가 설치된 경우에만 ##
    # Home: http://neo.sandoll.co.kr/
    ## Change font AppleGothic=AppleSDGothicNeo-Regular
    ## Change font AppleMyungjo=Nanum Myeongjo
    ###############################################################################
    
    
    ### M: Finder에선 불완전한 뫼비우스 (SK Telecom) ##############################
    # Home: http://www.tworld.co.kr/outsitens.jsp
    ## Download fonts from http://www.tworld.co.kr/html/t/download/Moebius_Regular_kor.zip
    ## Keep zip archive at ~/.fonts/Moebius/Moebius_Regular_kor.zip
    ## Change font AppleGothic=Moebius Korea
    # Download fonts from http://www.tworld.co.kr/html/t/download/Moebius_Bold_kor.zip
    # Keep zip archive at ~/.fonts/Moebius/Moebius_Bold_kor.zip
    # Change font AppleGothic=Moebius Korea Bold
    ###############################################################################
    
    ### O: Finder에선 불완전한 서울남산체 & 한강체 (서울서체) #####################
    # Home: http://design.seoul.go.kr/dscontent/designseoul.php?MenuID=490&pgID=237
    ## Download fonts from http://design.seoul.go.kr/js/boardFileDown.php?model=PolicyData&id=251&field_path=file_path&field_name=file_name1&no=1&is_crypt=false
    ## Keep zip archive at ~/.fonts/SeoulFonts/SeoulFonts_TTF.zip
    ## Change font AppleGothic=SeoulNamsan
    ## Change font AppleMyungjo=SeoulHangang
    ###############################################################################
    
    ### A: Finder에선 불완전한 아리따 돋움 (아모레퍼시픽) #########################
    # Home: http://www.amorepacific.com/about/about_font.jsp
    ## Download fonts from http://www.amorepacific.com/resources/download/about/font/arita_ttf.zip
    ## Keep zip archive at ~/.fonts/Arita/arita_ttf.zip
    ## Change font AppleGothic=Arita\-dotum(TTF)\-SemiBold
    ###############################################################################
    
    # No need to modify below this line, unless you know what you're doing.
    
    set -eu
    # sanitize environment
    PATH=/usr/bin:/bin
    CDPATH=
    clear
    
    # some vocabularies
    error() { echo "$@" >&2; }
    pause() { read -t${1:-5} || true; }
    hr() { echo -------------------------------------------------------------------------------; }
    indent() { sed '/^-/! s/^/  /'; }
    show-header() {
        sed -ne '/^### MacOSXDefaultFontFallbacksChanger ####*$/,/^####*$/ { /^## / s/^## //p; }' <"$0"
    }
    ProductName=$(sw_vers -productName)
    ProductVersion=$(sw_vers -productVersion)
    show-warning() {
        echo   "  WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING"
        echo   "  WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING"
        echo   "  WARNING                                                         WARNING"
        echo   "  WARNING   무슨 일이 생길 지 모르니 섣불리 진행하지 마십시오!!!  WARNING"
        printf "  WARNING   이 도구는 %14s에서 시험해보지 않았습니다!  WARNING\n" "$ProductName $ProductVersion"
        echo   "  WARNING   컴퓨터를 더 이상 못 쓰는 상태로 만들 수도 있습니다!!  WARNING"
        echo   "  WARNING                                                         WARNING"
        printf "  WARNING   This tool has not been tested on: %14s !!  WARNING\n" "$ProductName $ProductVersion"
        echo   "  WARNING   Your system may become unusable after modifications!  WARNING"
        echo   "  WARNING   DO NOT PROCEED UNLESS YOU KNOW WHAT YOU ARE DOING!!!  WARNING"
        echo   "  WARNING                                                         WARNING"
        echo   "  WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING"
        echo   "  WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING"
        hr
    }
    
    # fontsets embedded in comments
    list-fontsets() {
        sed -ne '/^### [A-Z0-9]: .* #*$/,/^####*$/ { /^### / { s/^### //; s/ #*$//g; p; }; }' <"$0"
    }
    fontset() {
        local key=$1
        if grep -q '^### '"$key"': ' "$0"; then
            sed -ne '/^### '"$key"': /,/^####*$/ { /^## / s/^## //p; }' <"$0"
        else
            false
        fi
    }
    substitute() { vimcmds+=("+%s/$1/$2/g"); }
    compile-fontset() {
        local line= i=0
        while read line; do
            case $line in
                "Download fonts from "*)
                    echo "URL='${line#Download fonts from }'"
                    ;;
                "Keep zip archive at "*)
                    echo "LocalPath=${line#Keep zip archive at }"
                    ;;
                "Change font "*)
                    local patt=${line#Change font }
                    echo "substitute '${patt%%=*}' '${patt#*=}'"
                    ;;
                *)
                    error "Syntax error for $key: $line" >&2
                    exit 2
                    ;;
            esac
            let i++
        done
        if [ $i -eq 0 ]; then
            echo "Empty rules for $key:" >&2
            exit 2
        fi
    }
    
    # property lists that control the default font fallbacks
    Plists=(
    /System/Library/Frameworks/ApplicationServices.framework/Versions/Current/Frameworks/CoreText.framework/Versions/Current/Resources/DefaultFontFallbacks.plist
    /System/Library/Frameworks/AppKit.framework/Versions/Current/Resources/NSFontFallbacks.plist
    )
    # version of this script
    
    # check compatibility with current Mac OS X version
    IsCompatible=false
    if [ x"$ProductName" = x"Mac OS X" ]; then
        case $ProductVersion in
            10.7|10.7.*|10.8|10.8.*) # Lion, Mountain Lion will probably remain compatible after minor updates
                IsCompatible=true
                ;;
            *) # unsure about other versions, display warning
                ;;
        esac
    fi
    
    # the main loop
    interact() {
        # listen to user for what to do
        {
            hr
            show-header
            hr
            $IsCompatible || show-warning
            list-fontsets
            hr
            echo  "R: 원상복구 / Reset to Original settings"
            echo  "Q: 종료     / Quit                      "
            hr
        } | indent
        read -n1 -p "키를 누르세요 / Press key: " key
        echo
        echo
    
        key=$(tr a-z A-Z <<<"$key") # ignoring case of input key,
        case $key in
            Q) # bye bye
                exit
                ;;
            R) # revert modifications
                echo 원상복구중 / Reverting to original settings...
                for plist in "${Plists[@]}"; do
                    if [ -e "$plist.orig" ]; then
                        sudo cp -pfv "$plist.orig" "$plist"
                    fi
                done
                echo 원래 설정을 적용하려면 재시동하거나 응용프로그램을 다시 띄웁니다.
                echo 경고: /System/Library/Fonts/ 아래에는 일부 파일이 남아있을 수 있습니다.
                echo Now reboot or restart your apps to use the Original settings.
                echo Warning: You may need to remove files from /System/Library/Fonts/ by hand.
                pause
                exit
                ;;
            *)
                # display details
                if fontset=$(list-fontsets | grep "^$key: "); then
                    fontset=${fontset#$key: }
                    {
                        hr
                        echo "$fontset"
                        hr
                        fontset "$key"
                        hr
                    } | indent
                else
                    echo "$key: 잘못된 키 / Undefined key" >&2
                    echo
                    return
                fi
                # give user a chance to abort
                read -n1 -p "위 설정을 진행할까요? Continue to change as above? (y or n) "; echo; echo
                case $REPLY in [yY]) true ;; *) return ;; esac
                
                # read the rules for fontset
                URL= LocalPath= vimcmds=()
                eval "$(fontset "$key" | compile-fontset)"
                # download and install ttfs
                if [ -n "$URL" -a -n "$LocalPath" ]; then
                    (
                    LocalDir=`dirname "$LocalPath"`
                    LocalName=`basename "$LocalPath"`
                    mkdir -p "$LocalDir"
                    cd "$LocalDir"
                    echo 글꼴 받는 중 / Downloading fonts from $URL...
                    completeFlag="$LocalName.complete"
                    if [ -e "$completeFlag" ]; then
                        # avoid downloading twice if we have a complete one
                        rm -f "$completeFlag"
                        curl -#LRkz "$LocalName" -o "$LocalName" "$URL" || curl -#LRko "$LocalName" "$URL"
                    else
                        # otherwise, try resuming the previous one
                        curl -#LRC - -o "$LocalName" "$URL" || curl -#LRko "$LocalName" "$URL"
                    fi
                    touch "$completeFlag"
                    tmp=tmp
                    ditto -x -k "$LocalName" $tmp || true
                    echo 글꼴 설치 중 / Installing fonts to /System/Library/Fonts/...
                    (
                    cd $tmp
                    find . -name '*.[ot]t[fc]' -exec sudo install -vm a=r {} /System/Library/Fonts \;
                    )
                    rm -rf $tmp
                    )
                fi
                # modify plist files
                echo 기본 글꼴 설정을 변경합니다 / Changing default font fallbacks...
                for plist in "${Plists[@]}"; do
                    if [ -e "$plist.orig" ]; then
                        # XXX following line prevents combination of independent changes :(
                        # however, this lets users to change fontsets without resetting to original
                        sudo cp -pf "$plist.orig" "$plist"
                    else
                        sudo cp -npv "$plist" "$plist.orig"
                    fi
                    echo " $plist"
                    sudo plutil -convert xml1 "$plist"
                    sudo vim -n +"set nobackup" "$plist" "${vimcmds[@]}" +wq
                    sudo plutil -convert binary1 "$plist"
                done
                echo "$fontset"을 쓰려면 재시동하거나 응용프로그램을 다시 시작 하십시오.
                echo Now reboot or restart your apps to use "$fontset".
                pause 7
                exit
                ;;
        esac
    }
    while true; do interact; done
    
    
    

    public by JMichaelTX modified Jan 24, 2016  200434  1  3  0

    [EN] Classic - Evernote Mac - Put Classic Note Link on Clipboard as Rich Text using Note Title -- AppleScript

    [EN] Classic - Evernote Mac - Put Classic Note Link on Clipboard as Rich Text using Note Title -- AppleScript: Copy EN Note Link (Classic) AS.scpt
    (*
      SCRIPT NAME:  Copy EN Note Link (Classic)
      
      DATE:  Sat, Jan 23, 2016    VER: 2.1.1
      
      PURPOSE:
        •  Get Classic link of selected Evernote Note
        •  Copy to Mac Clipboard as RTF (Rich Text Format) so that you can
          paste to most apps as a click-able link
        •  Text is EN Note Title
        •  Link is the "Classic", internal link to EN Mac Note
        
      AUTHOR:    JMichaelTX (member of Discussion.Evernote.com forum)
              Please PM me with any bugs/issues/questions
              
      REQUIRES:
        • Satimage.osax for HTML encode (encode entities)
          (Free D/L & info at http://tinyurl.com/Satimage-Osax-DL )
            
      INSTALLATION:
        •  There are several ways you can install and access this script
        •  SIMPLE METHOD
          •  Copy to your personal Scripts folder:  /Users/<YourName>/Library/Scripts/
            (create the Scripts folder if it does not exist)
          •  Select a Note in Evernote
          •  Click on the Apple Scripts menu in the upper right area of your menu
          •  Click on Copy EN Note Link (classic)
          •  Switch to your target app, and click in the text area where you want the link, and press CMD-V
        •  OTHER OPTIONS
          •  FastScripts -- http://www.red-sweater.com/fastscripts/
          •  Automator
          •  See article on Veritrope.com for details:  http://veritrope.com/tech/the-basics-using-keyboard-shortcuts-with-applescripts/
      
      REF:
        • I was inspired by:
          
          • This thread on Discussion.Evernote.com forum:
            https://discussion.evernote.com/topic/60623-how-can-make-the-classic-link-the-default-way-of-linking/
            
            • Post by patnpm
              https://discussion.evernote.com/topic/60623-how-can-make-the-classic-link-the-default-way-of-linking/#entry283106
            • Post by DanielB
              https://discussion.evernote.com/topic/60623-how-can-make-the-classic-link-the-default-way-of-linking/#entry291008
              
        • I adapted the code posted by:
        
          • alastor933 in the MacScripter.com forum
          • http://macscripter.net/viewtopic.php?pid=148647#p148647
    ======================================================================
    *)
    
    property bolDebug : false -- set to true to turn on diagnostic logs and dialogs.
    
    -- SET THE BELOW PROPERTIES TO REFLECT THE LINK STYLE YOU WANT ---
    
    property gstrFont : "font-family:verdana,geneva,sans-serif;"
    property gstrLinkFontSize : "font-size:14px;"
    property gStyleLink : "color:blue"
    
    
    tell application "Evernote"
      set lstSelectedNotes to selection
      
      if lstSelectedNotes ≠ {} then
        
        --- GET THE FIRST NOTE ---
        set oNote to first item of lstSelectedNotes
        
        --- GET THE NOTE TITLE AND CLASSIC NOTE LINK ---
        set strNoteTitle to title of oNote
        set strNoteLink to note link of oNote
        
        log strNoteTitle
        set strNewTitle to ""
        
        --- REPLACE EXTENDED ASCII CHARS BETWEEN 127-253 WITH SPACE --
        
        repeat with iChar from 1 to (length of strNoteTitle)
          set strChar to character iChar of strNoteTitle
          --set strLog to ("[" & iChar & "] " & (ASCII number of strChar) & ": " & strChar)
          --log strLog
          
          if ((ASCII number of strChar) > 126) and ((ASCII number of strChar) < 254) then
            set strNewTitle to strNewTitle & " "
          else
            set strNewTitle to strNewTitle & strChar
          end if
        end repeat
        
        ##  --- ENCODE THE NOTE TITLE ---  ##  
        --      (requires the Satimage.osax)
        
        set strNoteTitle to encode entities strNewTitle
        log strNoteTitle
        
        --- CREATE THE HTML ANCHOR CODE ---
        set strHTMLLink to my createHTMLLink(strNoteTitle, strNoteLink)
        set strHTMLLink to "<span style=\"" & gstrFont & gstrLinkFontSize & "\">" & strHTMLLink & "</span>"
        
        --- PUT THE HTML CODE ON THE CLIPBOARD AS RICH TEXT (RTF) ---
        my copyHTMLasRTFtoClipboard(strHTMLLink)
        
        set strMsg to strNewTitle
        set strMTitle to "Evernote Internal Link Copied to Clipboard for"
        display notification strMsg with title strMTitle sound name "Hero.aiff"
        
      end if -- lstSelectedNotes ≠ {}
      
    end tell
    
    --=====================================
    --  SUBPROGRAMS
    --=====================================
    
    ###——————————————————————————————————————————————
    #      Create HTML Link:    createHTMLLink
    ###——————————————————————————————————————————————
    
    on createHTMLLink(pstrLinkText, pstrURL)
      
      return "<a href=\"" & pstrURL & "\" style=\"" & gStyleLink & "\">" & pstrLinkText & "<a>"
      
    end createHTMLLink
    
    ###——————————————————————————————————————————————
    #      COPY HTML TO CLIPBOARD AS RTF:  copyHTMLasRTFtoClipboard
    ###——————————————————————————————————————————————
    
    on copyHTMLasRTFtoClipboard(pstrHTML)
      
      if bolDebug then display dialog "ENTER copyHTMLasRTFtoClipboard"
      
      -- REWRITTEN AS RTF AND COPIED TO THE CLIPBOARD
      set lstrCMD to "echo " & quoted form of pstrHTML & " | textutil -format html -convert rtf -stdin -stdout | pbcopy -Prefer rtf"
      do shell script lstrCMD
      
      if bolDebug then
        display notification pstrHTML with title "Copy RTF to Clipboard"
      end if
      
    end copyHTMLasRTFtoClipboard
    
    
    

    public by phuonght modified Jan 23, 2016  212081  0  3  0

    A small script to make recording http live streams (HLS, those streams that work on iOS devices) nicer on a Mac. Script records the stream for a defined period of time and sends the user notifications if anything goes wrong and once it's done.

    A small script to make recording http live streams (HLS, those streams that work on iOS devices) nicer on a Mac. Script records the stream for a defined period of time and sends the user notifications if anything goes wrong and once it's done.: HLS_dvr.sh
    # required: ffmpeg (e.g. from homebrew), terminal-notifier from https://github.com/alloy/terminal-notifier 
    # you can schedule this with launchd to run e.g. weekly
    
    # Specify in seconds how long the script should record (default here is 1 hour).
    seconds=3600
    
    # Date format for the recording file name
    DATE=`date "+%d-%m-%y_%H-%M"`
    
    # start ffmpeg recording
    ffmpeg -re -i http://website.com/playlist.m3u8 -c copy -bsf:a aac_adtstoasc recording_$DATE.mp4 &
    
    # notification that recording has started
    if [ "$(pgrep -P $$ 'ffmpeg')" ]
    then
    	/Applications/terminal-notifier.app/Contents/MacOS/terminal-notifier -title 'ffmpeg' -message "is recording now" -sender 'com.apple.Terminal'
    else
    	/Applications/terminal-notifier.app/Contents/MacOS/terminal-notifier -title 'ffmpeg' -message "is not recording!" -sound Funk -sender 'com.apple.Terminal'
    	exit 42
    fi
    
    # check every 30 seconds for $seconds to make sure ffmpeg is still running
    START=`date +%s`
    while [ $(( $(date +%s) - $seconds )) -lt $START ]; do
    	if [ -z "$(pgrep -P $$ 'ffmpeg')" ]
        	then
           		/Applications/terminal-notifier.app/Contents/MacOS/terminal-notifier -title 'ffmpeg' -message "is no longer running" -sound Funk -sender 'com.apple.Terminal'
      	fi
    	sleep 30
    done
    
    # notification when time is up
    /Applications/terminal-notifier.app/Contents/MacOS/terminal-notifier -title 'ffmpeg' -message "recording finished" -sound default -sender 'com.apple.Terminal'
    
    # stop ffmpeg (using this because stopping ffmpeg via -t for duration turned out to be extremely unreliable)
    kill $(pgrep -P $$ 'ffmpeg')
    
    
    

    public by cghersi modified Aug 12, 2014  204421  0  6  2

    Embed a browser into SWT Dialog and manage the firing of popups from links in the displayed page

    This is how to manage an embedded browser. Note: unfortunately this seems not working on some versions of Mac OS X.
    try {
    	Browser browser = new Browser(this, SWT.NONE);
    	browser.setJavascriptEnabled(true);
    	browser.setUrl("www.myurl.com");
    	browser.addOpenWindowListener(new OpenWindowListener() {
    		public void open(WindowEvent event) {
    			log.debug("Opening browser:" + event);
    			new Thread( new Runnable() {
    	            public void run() {
    	            	log.debug("some stuff t do here...");
    	            }
    			}).start();
    			
    			final Shell shell = new Shell(event.display);
    		    shell.setText("My Browser page");
    		    shell.setLayout(new FillLayout());
    		    event.browser = new Browser(shell, SWT.NONE);
    		    shell.open();
    		    
    		    event.browser.addCloseWindowListener(new CloseWindowListener() {
    				@Override
    				public void close(WindowEvent event) {
    					log.debug("closing");
    					shell.setVisible(false);
    				}
    			});
    		}
    	});
    } catch (Throwable t) {
    	//on some architecture seems that SWT Browser is not working...
    	log.warn("Cannot display SWT Browser");
    }

    public by Kevin Elliott modified Sep 30, 2015  100047  0  3  0

    Mac OS X 10.11 El Capitan Setup

    Mac OS X 10.11 El Capitan Setup: osx-10.11-setup.md
    # Mac OS X 10.11 El Capitan
    
    Custom recipe to get OS X 10.11 El Capitan running from scratch, setup applications and developer environment. This is very similar (and currently mostly the same) as my 10.10 Yosemite setup recipe (as found on this gist https://gist.github.com/kevinelliott/0726211d17020a6abc1f). Note that I expect this to change significantly as I install El Capitan several times.
    
    I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.
    
    This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.
    
    You are encouraged to fork this and modify it to your heart's content to match your own needs.
    
    ## Install Software
    
    The software selected is software that is "tried and true" --- software I need after any fresh install. I often install other software not listed here, but is handled in a case-by-case basis.
    
    ### Install from App Store
    
    * [Airmail](https://itunes.apple.com/us/app/airmail/id573171375?mt=12&uo=4)
    * [Aperture](https://itunes.apple.com/us/app/aperture/id408981426?mt=12&uo=4)
    * [Degrees](https://itunes.apple.com/us/app/degrees/id430173763?mt=12&uo=4)
    * [Divvy](https://itunes.apple.com/us/app/divvy-window-manager/id413857545?mt=12&uo=4)
    * [Opera](https://itunes.apple.com/us/app/opera/id404764921?mt=12&uo=4)
    * [Pages](https://itunes.apple.com/us/app/pages/id409201541?mt=12&uo=4)
    * [Skitch](https://itunes.apple.com/us/app/skitch-snap.-mark-up.-share./id425955336?mt=12&uo=4)
    * [Twitter](https://itunes.apple.com/us/app/twitter/id409789998?mt=12&uo=4)
    * [WiFi Explorer](https://itunes.apple.com/us/app/wifi-explorer/id494803304?mt=12&uo=4)
    * [WiFi Signal](https://itunes.apple.com/us/app/wifi-signal/id525912054?mt=12&uo=4)
    * [Todoist](https://itunes.apple.com/us/app/todoist-to-do-list-task-list/id585829637?mt=12&uo=4)
    * [Xcode](https://itunes.apple.com/us/app/xcode/id497799835?mt=12&uo=4)
    
    ### Install from Third-Party Websites
    
    * Browsers
    	* Chrome (installed via Cask)
    	* [Firefox](http://firefox.com)
    	* Opera (installed via App Store)
    	* [Webkit](http://webkit.org)
    
    * Development
    	* [Dropbox](https://www.dropbox.com/install2)
    	* [GitHub](http://mac.github.com)
    	* [LiveReload](http://livereload.com)
    	* [LiveReload Extensions](http://help.livereload.com/kb/general-use/browser-extensions)
    	* [Sublime Text 3](http://www.sublimetext.com/3)
    
    * Utilities
    	* [1Password](https://agilebits.com/onepassword/mac)
    	* [GrandPerspective](http://grandperspectiv.sourceforge.net/)
    	* [HipChat](https://www.hipchat.com/downloads)
    	* iTerm 2 (installed via Cask)
    	* [Little Snitch](http://www.obdev.at/products/littlesnitch/download.html)
    	* [Quicksilver](http://qsapp.com)
    	* [Skype](http://www.skype.com/en/download-skype/skype-for-computer/)
    	* [Spotify](https://www.spotify.com/us/download/mac/)
    	* [Transmit](http://panic.com/transmit)
    
    * Virtualization
    	* Parallels Desktop (installed via Cask)
    	* Docker (installed via brew)
    	* Vagrant (installed via Cask)
    
    Fonts
    -----
    [Mensch coding font](http://robey.lag.net/2010/06/21/mensch-font.html)
    
    #Xcode Command Line Tools
    
    `Xcode > Preferences > Downloads > Command Line Tools`
    
    
    #Homebrew
    
    ## Run Xcode and accept the license
    
    Homebrew can not install properly until this occurs.
    
    ## Install Homebrew
    ```bash
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    brew doctor
    ```
    
    At the time of this writing, `brew doctor` says that `Xcode 6.1` is required, which means downloading it from the Apple Developer Center until it is released in the Mac App Store.
    
    ## Install Homebrew extension Cask
    ```bash
    brew install caskroom/cask/brew-cask
    ```
    
    ## Install common applications via Homebrew
    *Databases are installed later.*
    ```bash
    brew install ack autojump automake colordiff curl git git-flow \
                 hub icoutils imagemagick libmemcached memcached openssl ossp-uuid qt \
                 readline redis tmux wget libxml2
    ```
    
    ## Install applications via Homebrew Cask
    ```bash
    brew cask install anvil
    brew cask install atom
    brew cask install authy-bluetooth
    brew cask install awareness
    brew cask install bartender
    brew cask install battery-guardian
    brew cask install github
    brew cask install google-chrome
    brew cask install joinme
    brew cask install iterm2
    brew cask install parallels
    brew cask install rescuetime
    brew cask install rubymine
    brew cask install satellite-eyes
    brew cask install sidestep
    brew cask install sonos
    brew cask install spotify
    brew cask install steam
    brew cask install vagrant
    brew cask install vagrant-manager
    ```
    
    ## Install Parallels plugin for Vagrant
    ```
    vagrant plugin install vagrant-parallels
    ```
    
    See http://parallels.github.io/vagrant-parallels/ for more details.
    
    
    #Shell
    
    Install custom .dotfiles
    ```bash
    git clone git@github.com:kevinelliott/.dotfiles.git ~/.dotfiles
    ~/.dotfiles/install.sh
    ```
    
    Update .bash_profile
    ```bash
    echo 'source ~/.dotfiles/base.sh' >> ~/.bash_profile
    ```
    
    # OS X Preferences
    
    ```bash
    
    #Set a blazingly fast keyboard repeat rate
    defaults write NSGlobalDomain KeyRepeat -int 0.02
    
    #Set a shorter Delay until key repeat
    defaults write NSGlobalDomain InitialKeyRepeat -int 12
    
    #Add a context menu item for showing the Web Inspector in web views
    defaults write NSGlobalDomain WebKitDeveloperExtras -bool true
    
    #Show the ~/Library folder
    chflags nohidden ~/Library
    
    #Store screenshots in subfolder on desktop
    mkdir ~/Desktop/Screenshots
    defaults write com.apple.screencapture location ~/Desktop/Screenshots
    ```
    
    Set hostname
    ------------
    `sudo scutil --set HostName SpaceX-Falcon-9`
    
    
    #Git
    
    Setup Github
    ------------
    ```bash
    ssh-keygen -t rsa -C "kevin@welikeinc.com"
    
    # Copy ssh key to github.com
    subl ~/.ssh/id_rsa.pub
    
    # Test connection
    ssh -T git@github.com
    
    # Set git config values
    git config --global user.name "Kevin Elliott"
    git config --global user.email "kevin@welikeinc.com"
    git config --global github.user kevinelliott
    git config --global github.token your_token_here
    
    git config --global core.editor "subl -w"
    git config --global color.ui true
    ```
    
    
    # Sublime Text
    
    Add Sublime Text CLI
    --------------------
    
    ```bash
    mkdir -p ~/bin && ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" ~/bin/subl
    ```
    
    Install Package Control
    -----------------------
    
    Run `Sublime Text 3` and access the console via the `CTRL + ``` shortcut or the `View > Show Console` menu.
    
    ```
    import urllib.request,os,hashlib; h = '7183a2d3e96f11eeadd761d777e62404' + 'e330c659d4bb41d3bdf022e94cab3cd0'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://sublime.wbond.net/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)
    ```
    
    See https://sublime.wbond.net/installation for more information. Their site has a note that this install code will change for each new release, so it would be good to check once in a while.
    
    Install Packages
    ----------------
    [BracketHighlighter](https://github.com/facelessuser/BracketHighlighter)
    [CoffeeScriptHaml](https://github.com/jisaacks/CoffeeScriptHaml)
    
    
    Install Soda Theme
    ----------------------
    ```bash
    git clone git://github.com/buymeasoda/soda-theme.git ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/Theme\ -\ Soda
    ```
    
    Install Tomorrow Theme
    ----------------------
    ```bash
    git clone git://github.com/chriskempson/textmate-tomorrow-theme.git ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/Color\ Scheme\ -\ Tomorrow
    ```
    
    Settings
    --------
    
    **Sublime Text > Preferences > Settings - User**
    
    ```json
    {
        "close_windows_when_empty": true,
        "color_scheme": "Packages/Color Scheme - Tomorrow/Tomorrow-Night-Eighties.tmTheme",
        "draw_indent_guides": false,
        "font_face": "Mensch",
        "font_size": 18,
        "highlight_modified_tabs": true,
        "show_tab_close_buttons": false,
        "tab_size": 2,
        "spell_check": false,
        "theme": "Soda Light.sublime-theme",
        "word_separators": "./\\()\"'-:,.;<>~!@#%^&*|+=[]{}`~?"
    }
    ```
    
    Key Bindings
    ------------
    
    ```json
    [
    	{ "keys": ["super+b"], "command": "expand_selection", "args": {"to": "brackets"} },
    	{ "keys": ["super+f"], "command": "show_panel", "args": {"panel": "replace"} },
    	{ "keys": ["super+alt+f"], "command": "show_panel", "args": {"panel": "find"} }
    ]
    ```
    
    
    Snippets
    --------
    ```bash
    git clone git@github.com:bytestudios/sublime-snippets.git "/Users/Joel/Library/Application Support/Sublime Text 2/Packages/Byte"
    ```
    
    
    ## Server
    
    
    ### Docker
    ```bash
    brew install docker boot2docker
    boot2docker init
    boot2docker up
    ```
    
    ### MySQL
    
    ```bash
    brew install mysql
    brew pin mysql
    ```
    
    ### MySQL Settings
    
    ```bash
    # Copy launch agent into place
    mkdir -p ~/Library/LaunchAgents && cp /usr/local/Cellar/mysql/VERSION/homebrew.mxcl.mysql.plist ~/Library/LaunchAgents/
    
    # Edit launch agent and set both keepalive and launch at startup to false
    vi ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
    
    # Inject launch agent
    launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
    
    # Set up databases to run as your user account
    unset TMPDIR && mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
    
    # Start mysql
    start mysql
    
    # Secure mysql
    /usr/local/Cellar/mysql/VERSION/bin/mysql_secure_installation
    ```
    
    
    ### PostgreSQL
    
    ```bash
    brew install postgres --no-ossp-uuid
    brew pin postgres
    ```
    
    ### PostgreSQL Settings
    
    ```bash
    # Initialize db if none exists already
    initdb /usr/local/var/postgres
    
    # Create launchctl script
    mkdir -p ~/Library/LaunchAgents
    cp /usr/local/Cellar/postgresql/VERSION/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/
    
    # Edit launchctl script (set to not start automatically and keepalive false)
    subl ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
    
    # Inject launchctl script
    launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
    
    # Start PostgreSQL
    start pg
    ```
    
    ### Ruby Gems
    
    #### libv8 / therubyracer
    ```bash
    brew uninstall v8
    gem uninstall libv8
    brew install v8
    gem install therubyracer
    gem install libv8 -v 3.16.14.3 -- --with-system-v8
    ```
    
    #### nokogiri
    ```bash
    brew tap homebrew/dupes
    brew install libxml2 libxslt libiconv
    gem install nokogiri -- --with-iconv-dir=/usr/local/Cellar/libiconv/VERSION/
    ```
    
    #### capybara-webkit
    ```bash
    brew install -v https://raw.github.com/cliffrowley/homebrew/patched_qt/Library/Formula/qt.rb --HEAD --without-ssse3
    gem install capybara-webkit -v '0.9.0'
    ```
    
    ![aww yeah](http://i.imgur.com/AmFax.gif)
    
    

    public by lbottaro modified Apr 6, 2015  2195  2  6  0

    Set screen resolution for Mac OS in VirtualBox

    Here a snippet to set the screen resolution for Mac OS running on VirtualBox on Windows, using vboxmanage tool Please note you have to specify your exact VM name, like "Mac OS Mountain Lion"
    C:\Program Files\Oracle\VirtualBox>VboxManage setextradata "Mac OS Mountain Lion" "GUI/CustomVideoModel" "1600x900x64"
    
    C:\Program Files\Oracle\VirtualBox>VboxManage setextradata "Mac OS Mountain Lion" "CustomVideoModel" "1600x900x64"                                                

    public by micurs modified Mar 12, 2014  38974  458  10  8

    Using crypto-js in node.js with Typescript

    You can easily install the crypto-js library in node by using the command (on Mac): npm install crypto-js After that you need to download its type definition from Git/DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped/tree/master/cryptojs To make it work, however you need to add the following to the cryptojs.d.ts:
    // add this at the end of crypto.d.ts
      declare module "crypto-js" {
        export = CryptoJS;
      }
    
    // Then you can use the module in typescript
    
    ///<reference path='../types/node.d.ts'/>
    ///<reference path='../types/cryptojs.d.ts'/>
    
    import crypto = require("crypto-js");  
    
    function writeln( msg: string ) {
      process.stdout.write( msg +'\n');
    }
    
    var message : string = "Hello Encrypted World!";
    var cmessage : string = crypto.HmacSHA1( message , "1234").toString();
    writeln( message );
    writeln( cmessage );
    

    public by JMichaelTX modified Feb 23, 2016  2087  1  3  0

    Evernote Mac (EN Mac) Get and Sort Large List of Notes by Note Property using AppleScript and ASObjC.

    Evernote Mac (EN Mac) Get and Sort Large List of Notes by Note Property using AppleScript and ASObjC.: EN Mac Get & Sort Notes by Property AS.applescript
    (*
    ===============================================================================
    	[EN] Get and Sort Notes by Note Property Using "every note" Method & ASObJC [AS]
    ===============================================================================
    
    VER: 	2.0		LAST UPDATE:   2016-02-22
    
    PURPOSE:
    	• Get and Sort Notes by Note Property Using "every note" Method & ASObJC
    	• This script can handle very large list of Notes
    	• Can get and sort 4,000 notes in less than 0.9 seconds.
    
    AUTHOR:		JMichaelTX
    					with a GIANT assist from @Shane Stanley and @hhas
    					
    					All errors are mine.  Credit for the core approach and code goes
    					to the above.
    					
    					Find any bugs/issues or have suggestions for improvement?
    					Contact me via PM or at blog.jmichaeltx.com/contact/
    
    REQUIRED:
    	1.	Mac OS X Yosemite 10.10.5+
    	2.	Mac Applications
    				• Evernote Mac 6.4+
    				
    	3.	EXTERNAL OSAX Additions/LIBRARIES/FUNCTIONS
    	
    				• BridgePlus 1.3.1 Script Library by Shane Stanley
    				  https://www.macosxautomation.com/applescript/apps/BridgePlus.html
    					
    	4.	INTERNAL FUNCTIONS:
    				• timer()		Calculate and Log Execution Time  (non-essential)
    				• continueScript()			Prompt User to Continue or Not
    
    REF:  The following were essential in the writing of this script.
    
    	1.	Using the "every note" method pointed out by @hhas at MacScripter.net
    	    http://macscripter.net/viewtopic.php?pid=184925#p184925
    			
    	2.  Using the ASOBjC sort facility in BridgePlus by Shane Stanley
    	    http://macscripter.net/viewtopic.php?pid=184936#p184936
    			
    ===============================================================================
       
    *)
    
    use AppleScript version "2.4" -- Yosemite 10.10.5+
    use scripting additions
    use framework "Foundation"
    use BPLib : script "BridgePlus"
    load framework
    
    
    timer("start")
    
    --~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    --	GET LISTS OF Evernote NOTE PROPERTIES TO SEARCH ON --
    --~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    tell application "Evernote"
    	
    	set notebookStr to "MyBigNotebook" -- change to your Notebook
    	
    	tell every note in notebook notebookStr
    		
    		set titleList to its title
    		set modDateList to its modification date -- will be main sort key in this example
    		set noteLinkList to its note link -- will be used to get actual Note after sort
    		
    	end tell -- note
    	
    	set numNotes to count of noteLinkList
    	log numNotes
    	
    	(* --- UNCOMMENT IF YOU'D LIKE A COMPARISION
    	--- LOG RESULTS BEFORE SORT FOR COMPARISION ---
    	
    	log "~~~~~ 	BEFORE SORT ~~~~~~~"
    	set indexList to 1
    	set modDate to item indexList of modDateList
    	set noteLink to item indexList of noteLinkList
    	set oNote to find note noteLink -- GET REF TO ACTUAL NOTE OBJECT
    	set titleStr to title of oNote
    	
    	log "Mod Date: " & modDate & "
         Title: " & titleStr
    	*)
    	
    end tell -- Evernote
    
    timer("AFTER GET EN LISTS")
    
    --- CONFIRM CONTINUE WITH SCRIPT ---
    set msgStr to "Number of Notes to Process: " & numNotes
    if not (my continueScript(msgStr)) then error number -128 -- user canceled
    
    timer("start") -- restart timer after dialog
    
    --~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    --	SORT EVERNOTE NOTE LISTS --
    --  (requires BridgePlus Script Lib)
    --~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    --- Convert Date List To Cocoa Format ---
    --	(Needed ONLY for Yosemite 10.10)
    set modDateList to Cocoaify modDateList -- needed for Yosemite 10.10
    
    --- Setup the Sort ---
    set listPairs to BPLib's colsToRowsIn:{modDateList, noteLinkList}
    
    --- Do the Sort
    set listPairs to BPLib's sublistsIn:listPairs sortedByIndexes:{1, 2} ascending:{true} sortTypes:{}
    
    --- Get Sort Results ---
    set {modDateList, noteLinkList} to BPLib's colsToRowsIn:listPairs
    
    --- De-Cocoaify Date List For Yosemite 10.10 ---
    set modDateList to ASify from modDateList
    
    tell application "Evernote"
    	
    	log "~~~~~ 	AFTER SORT ~~~~~~~"
    	
    	set indexList to 1 -- should be oldest Note
    	
    	set modDate to item indexList of modDateList
    	set noteLink to item indexList of noteLinkList
    	set oNote to find note noteLink -- GET REF TO ACTUAL NOTE OBJECT
    	set titleStr to title of oNote
    	
    	log "Mod Date: " & modDate & "
        Title: " & titleStr
    	
    end tell -- Evernote
    
    timer("STOP")
    --~~~~~~~~~~~~~~~~~~~~~ END OF MAIN SCRIPT ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ###——————————————————————————————————————————————
    #			continueScript()			Prompt User to Continue or Not
    #
    #			Ver 2.1								2016-02-21
    ###——————————————————————————————————————————————
    
    on continueScript(pMsgStr)
    	
    	beep
    	
    	set titleStr to (name of me) & "
    
    " & pMsgStr & "
    
    
    " & "Continue or Cancel?"
    	
    	
    	set recAns to (display alert titleStr as critical ¬
    		buttons {"Cancel", "Continue"}) -- last button is default
    	set strAns to button returned of recAns
    	
    	if (strAns = "Continue") then
    		set continueBol to true
    	else
    		set continueBol to false
    	end if
    	
    	return continueBol
    	
    end continueScript
    ###——————————————————————————————————————————————
    
    
    ###——————————————————————————————————————————————
    #			timer()		Calculate and Log Execution Time
    #
    #			Ver 1.0		2016-02-21
    #
    #			REF:  The base ASObjC code was provided by Shane Stanley
    ###——————————————————————————————————————————————
    
    on timer(pAction)
    	(*
    	### Requires these two statements at top of main script: ###
    		 	use scripting additions
    		 	use framework "Foundation"
    *)
    	global gTimerStartDate
    	if (pAction = "start") then
    		set gTimerStartDate to current application's NSDate's |date|()
    		log "START: " & ((current date) as text)
    	else
    		log pAction & ":  
        • " & ((current date) as text) & "
        • EXECUTION TIME: " & (round (-(gTimerStartDate's timeIntervalSinceNow())) * 1000) / 1000.0 & " sec"
    	end if
    end timer
    
    
    • Public Snippets
    • Channels Snippets