Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitavoloboev committed Aug 21, 2018
1 parent 56f6f38 commit 87f33b3
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 90 deletions.
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"version": "2.0.0",
"tasks": [
{
"taskName": "alfred build",
"label": "alfred build",
"type": "shell",
"command": "alfred build",
"group": {
Expand Down
7 changes: 4 additions & 3 deletions curated-lists.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ func doSearchLists() error {

log.Printf("query=%s", query)

parseList()
// TODO: where is cache placed?
parseList("lists.md")

if query != "" {
wf.Filter(query)
Expand All @@ -40,8 +41,8 @@ func doSearchLists() error {
}

// parseList parses a markdown list for links.
func parseList() {
bytes, _ := ioutil.ReadFile("lists.md")
func parseList(file string) {
bytes, _ := ioutil.ReadFile(file)

// Regex to extract markdown links
re := regexp.MustCompile(`\[([^\]]*)\]\(([^)]*)\)`)
Expand Down
3 changes: 1 addition & 2 deletions learn-anything.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type Topic struct {
Key string `json:"key"`
}

// doSearch searches all Learn Anything topics.
// doSearchTopics searches all Learn Anything topics.
func doSearchTopics() error {
showUpdateStatus()
log.Printf("query=%s", query)
Expand All @@ -37,7 +37,6 @@ func doSearchTopics() error {
wf.WarnEmpty("No matching items", "Try a different query?")
wf.SendFeedback()
return nil

}

// loadVaules returns ID's and keys from read JSON file.
Expand Down
1 change: 0 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ func doTest() error {
return nil
}

// main wraps run() (actual entry point) to catch errors
func main() {
wf.Run(run)
}
126 changes: 45 additions & 81 deletions workflow/info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>bundleid</key>
<string>nikivi.learn-anything</string>
<string>nikivi.learn.anything</string>
<key>category</key>
<string>Mine</string>
<key>connections</key>
Expand Down Expand Up @@ -65,7 +65,7 @@
<key>modifiers</key>
<integer>1048576</integer>
<key>modifiersubtext</key>
<string>Contributing guidelines</string>
<string>View contributing guidelines</string>
<key>vitoclose</key>
<false/>
</dict>
Expand Down Expand Up @@ -108,16 +108,6 @@
</array>
<key>790627A4-87DA-408A-BC71-90FA3D9CDF36</key>
<array>
<dict>
<key>destinationuid</key>
<string>D42BF709-D05C-44B7-94A2-3BDC5BF37CC6</string>
<key>modifiers</key>
<integer>1048576</integer>
<key>modifiersubtext</key>
<string>Open in Chrome</string>
<key>vitoclose</key>
<false/>
</dict>
<dict>
<key>destinationuid</key>
<string>238CAD6B-EF29-4AF9-8A6D-A45407BBC0CE</string>
Expand Down Expand Up @@ -153,25 +143,6 @@
<string>Learn Anything</string>
<key>objects</key>
<array>
<dict>
<key>config</key>
<dict>
<key>browser</key>
<string>com.google.Chrome</string>
<key>spaces</key>
<string></string>
<key>url</key>
<string>https://learn-anything.xyz/{query}</string>
<key>utf8</key>
<true/>
</dict>
<key>type</key>
<string>alfred.workflow.action.openurl</string>
<key>uid</key>
<string>D42BF709-D05C-44B7-94A2-3BDC5BF37CC6</string>
<key>version</key>
<integer>1</integer>
</dict>
<dict>
<key>config</key>
<dict>
Expand Down Expand Up @@ -204,9 +175,9 @@
<key>scriptfile</key>
<string></string>
<key>subtext</key>
<string>Open Maps</string>
<string>Search topics</string>
<key>title</key>
<string>Learn anything</string>
<string>Learn Anything</string>
<key>type</key>
<integer>0</integer>
<key>withspace</key>
Expand All @@ -219,19 +190,6 @@
<key>version</key>
<integer>2</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>triggerid</key>
<string>learn</string>
</dict>
<key>type</key>
<string>alfred.workflow.trigger.external</string>
<key>uid</key>
<string>05C2CDF4-B8F6-48B5-9DCC-75AC001E1500</string>
<key>version</key>
<integer>1</integer>
</dict>
<dict>
<key>config</key>
<dict>
Expand All @@ -251,6 +209,19 @@
<key>version</key>
<integer>1</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>triggerid</key>
<string>search learn anything</string>
</dict>
<key>type</key>
<string>alfred.workflow.trigger.external</string>
<key>uid</key>
<string>05C2CDF4-B8F6-48B5-9DCC-75AC001E1500</string>
<key>version</key>
<integer>1</integer>
</dict>
<dict>
<key>config</key>
<dict>
Expand All @@ -274,7 +245,7 @@
<key>config</key>
<dict>
<key>triggerid</key>
<string>lists</string>
<string>search curated lists</string>
</dict>
<key>type</key>
<string>alfred.workflow.trigger.external</string>
Expand Down Expand Up @@ -456,7 +427,9 @@ echo -n "${query//#readme}"</string>
</dict>
</array>
<key>readme</key>
<string>Details on how to effectively use this workflow are found in the GitHub repository attached to this workflow.
<string>Details on how to use this workflow are found in the GitHub repo attached to the workflow.
Double click this workflow in sidebar -&gt; Open website.
Post any issues and feature requests you have there. 💜</string>
<key>uidata</key>
Expand All @@ -466,28 +439,28 @@ Post any issues and feature requests you have there. 💜</string>
<key>xpos</key>
<integer>10</integer>
<key>ypos</key>
<integer>60</integer>
<integer>10</integer>
</dict>
<key>0AFED35D-0B15-4070-A6C4-E762A091EC86</key>
<dict>
<key>xpos</key>
<integer>460</integer>
<integer>420</integer>
<key>ypos</key>
<integer>460</integer>
<integer>290</integer>
</dict>
<key>238CAD6B-EF29-4AF9-8A6D-A45407BBC0CE</key>
<dict>
<key>xpos</key>
<integer>370</integer>
<integer>360</integer>
<key>ypos</key>
<integer>180</integer>
<integer>10</integer>
</dict>
<key>2C61650C-01F2-4BC7-AAE0-8C31508A2833</key>
<dict>
<key>xpos</key>
<integer>10</integer>
<key>ypos</key>
<integer>400</integer>
<integer>230</integer>
</dict>
<key>4F774142-7D29-4E25-8B08-5CCEAA253E53</key>
<dict>
Expand All @@ -496,76 +469,67 @@ Post any issues and feature requests you have there. 💜</string>
<key>xpos</key>
<integer>170</integer>
<key>ypos</key>
<integer>400</integer>
<integer>230</integer>
</dict>
<key>60D56C11-AA30-44D1-82E2-67C0A0B87073</key>
<dict>
<key>xpos</key>
<integer>620</integer>
<integer>580</integer>
<key>ypos</key>
<integer>490</integer>
<integer>320</integer>
</dict>
<key>62FC303E-01BA-430E-BC35-C7365486A097</key>
<dict>
<key>note</key>
<string>Contributing guidelines</string>
<string>View contributing guidelines</string>
<key>xpos</key>
<integer>720</integer>
<integer>670</integer>
<key>ypos</key>
<integer>460</integer>
<integer>290</integer>
</dict>
<key>72B1AA05-3281-415B-9252-9036D705817A</key>
<dict>
<key>xpos</key>
<integer>460</integer>
<integer>420</integer>
<key>ypos</key>
<integer>590</integer>
<integer>440</integer>
</dict>
<key>790627A4-87DA-408A-BC71-90FA3D9CDF36</key>
<dict>
<key>note</key>
<string>Search topics</string>
<key>xpos</key>
<integer>160</integer>
<integer>180</integer>
<key>ypos</key>
<integer>60</integer>
<integer>10</integer>
</dict>
<key>A2A341B0-792A-43F0-A4F7-7F2755274850</key>
<dict>
<key>note</key>
<string>Edit list</string>
<key>xpos</key>
<integer>720</integer>
<integer>670</integer>
<key>ypos</key>
<integer>590</integer>
<integer>440</integer>
</dict>
<key>AEABCB9D-9232-43D3-8640-84C9451203E0</key>
<dict>
<key>xpos</key>
<integer>620</integer>
<integer>580</integer>
<key>ypos</key>
<integer>620</integer>
<integer>470</integer>
</dict>
<key>C7FE3DF8-D5CD-4468-8CE0-BB050EF48F17</key>
<dict>
<key>xpos</key>
<integer>460</integer>
<key>ypos</key>
<integer>320</integer>
</dict>
<key>D42BF709-D05C-44B7-94A2-3BDC5BF37CC6</key>
<dict>
<key>note</key>
<string>Adding resources to maps works better on Chrome currently</string>
<key>xpos</key>
<integer>370</integer>
<integer>420</integer>
<key>ypos</key>
<integer>10</integer>
<integer>150</integer>
</dict>
</dict>
<key>version</key>
<string>2.3.5</string>
<string>2.4</string>
<key>webaddress</key>
<string>https://github.com/nikitavoloboev/alfred-learn-anything</string>
<string>https://github.com/nikitavoloboev/alfred-learn-anything#readme</string>
</dict>
</plist>
4 changes: 2 additions & 2 deletions workflow/maps.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
{"mapID":654,"key":"aliasing","title":"learn anything - information theory - signals - signal processing - digital signal processing - aliasing"}
{"mapID":110,"key":"cell division","title":"learn anything - biology - organisms - cells - cell division"}
{"mapID":8,"key":"animation","title":"learn anything - art - animation"}
{"mapID":1666,"key":"typescript programming language","title":"learn anything - programming - programming languages - typescript"}
{"mapID":1666,"key":"typeScript programming language","title":"learn anything - programming - programming languages - typescript"}
{"mapID":288,"key":"lexical analysis","title":"learn anything - computer science - compilers - lexical analysis"}
{"mapID":1545,"key":"uncertainty principle","title":"learn anything - physics - quantum mechanics - uncertainty principle"}
{"mapID":1789,"key":"group dynamics","title":"learn anything - sociology - social groups - group dynamics"}
Expand Down Expand Up @@ -1932,4 +1932,4 @@
{"mapID":1076,"key":"Bayes’ theorem","title":"learn anything - mathematics - statistics - bayesian statistics - bayes theorem"}
{"mapID":1209,"key":"domain name system","title":"learn anything - network science - computer networking - internet - domain name system"}
{"mapID":641,"key":"solid-state drives","title":"learn anything - information theory - information - data storage - solid state drives"}
{"mapID":735,"key":"polish language","title":"learn anything - linguistics - languages - polish"}
{"mapID":735,"key":"polish language","title":"learn anything - linguistics - languages - polish"}

0 comments on commit 87f33b3

Please sign in to comment.