Jump to content


Photo

Run Cheaters by Brett Terpstra Workflow

workflow automator cheaters cheatsheets

  • Please log in to reply
17 replies to this topic

#1 stouty

stouty

    Member

  • Member
  • PipPip
  • 31 posts

Posted 13 April 2013 - 05:06 PM

Hit your hotkey and Cheaters will appear in a web-popup.

 

Cheaters is a customizable cheat sheet system for OS X written by Brett Terpstra.

 

cheat.jpeg

 

 

Dependencies
 
Git (I tested with v1.7.12.4 and v1.8.2.1)
 
System Modifications
 
Downloads the Cheaters source code into ${HOME}/Library/Application Support/Alfred 2/Workflow Data/com.stouty.cheaters/cheaters directory. It's NOT deleted if you delete the workflow.
 

Download

 

v1.3 - Cheaters.alfredworkflow

 

UPDATE: 19th May 2013

 

v1.5 - Cheaters.alfredworkflow - Updated Git workflow and improved PATH search

 

 

Source code

 

Blog Post

 

To-Do

  • Find more elegant solution to the Automator Launcher spinning gear icon hack. I tried this as both an Automator workflow and an application, both spawn the spinning gear. If everyone had Bartender, the spinning gear could be hidden by Bartender and there would be no need for the two workflows. Suggestions welcome!
  • Update Cheaters git repo from origin/upstream master.
  • Show progress indicator when cloning/updating.
  • DONE: Implement update logic. I should have put the git repo in ~/Library/Application Support/Alfred 2/Workflow Data/$bundle_id. As it is now, the Cheaters git repo is wiped out when you install a new version of the workflow.
  • DONE: Make Alleyoop compatible.

Edited by stouty, 18 May 2013 - 11:24 PM.

  • BabyAzerty likes this

#2 BabyAzerty

BabyAzerty

    Newbie

  • New Member
  • Pip
  • 5 posts

Posted 14 April 2013 - 11:46 AM

I am having an Error with cheaters.

"ERROR /Users/me/Library/Application Support/Alfred 2/Alfred.alfre..."

 

I've placed the cheaters folder as you told.

 

9163365_2540x504.png

 



#3 stouty

stouty

    Member

  • Member
  • PipPip
  • 31 posts

Posted 14 April 2013 - 03:53 PM

I am having an Error with cheaters.

"ERROR /Users/me/Library/Application Support/Alfred 2/Alfred.alfre..."

 

I've placed the cheaters folder as you told.

 

What's the full error? Can you check your console.app log? Open /Applications/Utilities/Console.app then run the workflow and look in system.log for "Alfred Workflow" errors.



#4 stouty

stouty

    Member

  • Member
  • PipPip
  • 31 posts

Posted 14 April 2013 - 04:04 PM

I am having an Error with cheaters.

"ERROR /Users/me/Library/Application Support/Alfred 2/Alfred.alfre..."

 

I've placed the cheaters folder as you told.

 

Wait, did you move the cheaters directory manually? I don't see the .git folder in your cheaters folder.

 

See mine:

 

git.png

 

 

Have you made any edits to index.html? If so, copy it somewhere safe, then delete the cheaters dir, and re-run the workflow, then copy your edited index.html back, and run git commit -m 'my changes' on the terminal. Only if you changed index.html, otherwise just delete and re-run the workflow.



#5 stouty

stouty

    Member

  • Member
  • PipPip
  • 31 posts

Posted 14 April 2013 - 04:48 PM

I wonder if it's a bash version issue? Could you run 

 

 

 

type -a bash

which bash

bash --version
 

In your Terminal?

 

thanks



#6 stouty

stouty

    Member

  • Member
  • PipPip
  • 31 posts

Posted 14 April 2013 - 04:55 PM

Could you try this debug version?

 

It writes some info to a file on your Desktop -> ~/Desktop/Cheaters_DEBUG.txt

 

Could you send me the file if you have chance?

 

thanks

James



#7 BabyAzerty

BabyAzerty

    Newbie

  • New Member
  • Pip
  • 5 posts

Posted 14 April 2013 - 09:42 PM

Hi stouty !

 

Here is what tells me the console log

14/04/13 23:37:07,813 Alfred Workflow[1006]: ERROR: /Users/jeromepasquier/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.9E20A77E-5513-4FC2-9C7D-C89152F3D59B/Cheaters.workflow NOT found, cannot continue
 

 

When I download the zip from github, there is no .git folder. Do I have to clone it ?

 

 

I typed the 3 lines in the terminal and this is what it says :

$ type -a bash
bash is /bin/bash
$ which bash
/bin/bash
$ bash --version
GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin12)
Copyright © 2007 Free Software Foundation, Inc.

 

 

And finally, here is the DEBUG.txt

https://dl.dropboxus...aters_DEBUG.txt



#8 stouty

stouty

    Member

  • Member
  • PipPip
  • 31 posts

Posted 14 April 2013 - 10:49 PM

Ah, found the bug.

 

New version here.

 

Hope that one works.



#9 BabyAzerty

BabyAzerty

    Newbie

  • New Member
  • Pip
  • 5 posts

Posted 14 April 2013 - 11:01 PM

Hmmm...

15/04/13 00:53:32,506 Alfred Workflow[1365]: ERROR: NOT a git repo

 

I had to clone it to get the .git.

Then I replaced the cheater folder with the new one from the clone.

 

But then a pop up appeared asking me to do override something about LOCAL files. I said yes. Then a notification appeared :

HEAD is now at 03322a4 add siri to demo ...

 

And after calling the workflow, I have this error:

ERROR the workflow file does not exist.

/Users/foobar/Library/Application Support/Alfred 2/Alfred.alfre...

 

 

Very strange =/



#10 stouty

stouty

    Member

  • Member
  • PipPip
  • 31 posts

Posted 14 April 2013 - 11:10 PM

Delete the /Users/jeromepasquier/Library/Application Support/Alfred 2/Workflow Data/com.stouty.cheaters/cheaters directory, then re-run. It should do the clone for you.



#11 twinpeaks

twinpeaks

    Member

  • Member
  • PipPip
  • 173 posts

Posted 15 April 2013 - 05:49 AM

I'm having the same exact errors as BabyAzerty, every error he/she has encountered has been the same for me. I don't know why, but I just tried your latest version from git hub as of this post time... Thanks anyhow! Hopefully it works for some people.


 


#12 javatseng

javatseng

    Newbie

  • Member
  • Pip
  • 18 posts

Posted 15 April 2013 - 07:08 AM

It works for me. Thanks.



#13 BabyAzerty

BabyAzerty

    Newbie

  • New Member
  • Pip
  • 5 posts

Posted 15 April 2013 - 10:24 AM

Hey stouti !

 

I did deleted the cheaters directory and re-run.

It clone it for me. However I still have the same error

ERROR the workflow file does not exist.

/Users/foobar/Library/Application Support/Alfred 2/Alfred.alfre...

 

='(



#14 stouty

stouty

    Member

  • Member
  • PipPip
  • 31 posts

Posted 16 April 2013 - 01:05 PM

Apologies for the issues. I think I've fixed it now.

 

New version here.

 

[link in original post also updated]


  • BabyAzerty likes this

#15 BabyAzerty

BabyAzerty

    Newbie

  • New Member
  • Pip
  • 5 posts

Posted 16 April 2013 - 06:15 PM

Hi Stouty !

 

This time is the RIGHT one !

 

You are great ! Thank you =)



#16 jeffmilton

jeffmilton

    Newbie

  • New Member
  • Pip
  • 1 posts

Posted 17 May 2013 - 02:16 AM

5/16/13 8:10:57.821 PM Alfred Workflow[4882]: ERROR: git is NOT installed, cannot continue
 

but when I type git in terminal:

 

 

Macintosh:bin $ git
usage: git [--version] [--help] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]
 
The most commonly used git commands are:
   add        Add file contents to the index
   bisect     Find by binary search the change that introduced a bug
   branch     List, create, or delete branches
   checkout   Checkout a branch or paths to the working tree
   clone      Clone a repository into a new directory
   commit     Record changes to the repository
   diff       Show changes between commits, commit and working tree, etc
   fetch      Download objects and refs from another repository
   grep       Print lines matching a pattern
   init       Create an empty Git repository or reinitialize an existing one
   log        Show commit logs
   merge      Join two or more development histories together
   mv         Move or rename a file, a directory, or a symlink
   pull       Fetch from and merge with another repository or a local branch
   push       Update remote refs along with associated objects
   rebase     Forward-port local commits to the updated upstream head
   reset      Reset current HEAD to the specified state
   rm         Remove files from the working tree and from the index
   show       Show various types of objects
   status     Show the working tree status
   tag        Create, list, delete or verify a tag object signed with GPG
 
See 'git help <command>' for more information on a specific command.
Macintosh:bin jeffmilton$ git
usage: git [--version] [--help] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]
 
The most commonly used git commands are:
   add        Add file contents to the index
   bisect     Find by binary search the change that introduced a bug
   branch     List, create, or delete branches
   checkout   Checkout a branch or paths to the working tree
   clone      Clone a repository into a new directory
   commit     Record changes to the repository
   diff       Show changes between commits, commit and working tree, etc
   fetch      Download objects and refs from another repository
   grep       Print lines matching a pattern
   init       Create an empty Git repository or reinitialize an existing one
   log        Show commit logs
   merge      Join two or more development histories together
   mv         Move or rename a file, a directory, or a symlink
   pull       Fetch from and merge with another repository or a local branch
   push       Update remote refs along with associated objects
   rebase     Forward-port local commits to the updated upstream head
   reset      Reset current HEAD to the specified state
   rm         Remove files from the working tree and from the index
   show       Show various types of objects
   status     Show the working tree status
   tag        Create, list, delete or verify a tag object signed with GPG
 
See 'git help <command>' for more information on a specific command.


#17 stouty

stouty

    Member

  • Member
  • PipPip
  • 31 posts

Posted 17 May 2013 - 08:58 AM



 

5/16/13 8:10:57.821 PM Alfred Workflow[4882]: ERROR: git is NOT installed, cannot continue
 

but when I type git in terminal:

 

 

Macintosh:bin $ git
usage: git [--version] [--help] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]
 
<snip>
 
See 'git help <command>' for more information on a specific command.

 

 

 

I think your git command is not in the path inherited by the Alfred process

 

Can you type in a Terminal and post the results

echo $PATH
which git
type -P git
type -ap git

Then in Alfred create a new blank workflow, say hotkey to script, oh hold on ... here, try this:

 

getGitPath.alfredworkflow

 

See what the output is (it's posted as a large type notification and copied to the clipboard for you to paste in here)

 

For me:

 

 

$ echo $PATH
/Users/james/.rbenv/shims:/Users/james/.rbenv/bin:/usr/local/bin:/usr/local/sbin:/usr/local/share/npm/bin:/Users/james/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/james/Projects/Scripts:/Users/james/Scripts

$ which git
/usr/local/bin/git

$ type -P git
/usr/local/bin/git

$ type -ap git
/usr/local/bin/git
/usr/bin/git
/usr/local/bin/git

The from the workflow:

 

 

PATH = /usr/bin:/bin:/usr/sbin:/sbin
which git = [/usr/bin/git]

So the Cheaters workflow works for me as I have two gits installed.

 

Two options:

 

1. I add a load of paths to the Info.plist and export them. e.g. 

 

 

export PATH=/usr/local/bin:/usr/local/sbin:/usr/local/share/npm/bin:/usr/bin:/bin:/usr/sbin:/sbin
 
resulting from getGitPath.alfredworkflow in:

 

PATH = /usr/local/bin:/usr/local/sbin:/usr/local/share/npm/bin:/usr/bin:/bin:/usr/sbin:/sbin
which git = [/usr/local/bin/git]
2. I spend a little time finding the right git in my workflow.
 
I'll opt for 2 and submit an update, but I'd like to see your output if possible to make sure I am thinking along the right lines.
 
thanks
James
 

 

 

 

 

 

 

 


Edited by stouty, 17 May 2013 - 09:00 AM.


#18 stouty

stouty

    Member

  • Member
  • PipPip
  • 31 posts

Posted 18 May 2013 - 10:01 PM

Updated to v1.5 - Improved Git workflow and improved PATH search

 

 

Update via Alleyoop or manual download:  Cheaters.alfredworkflow

 

Let me know if that sorts things out for you.

 

thanks


Edited by stouty, 18 May 2013 - 11:24 PM.




Also tagged with one or more of these keywords: workflow, automator, cheaters, cheatsheets

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users