Skip to content

Commit

Permalink
subl updated
Browse files Browse the repository at this point in the history
Signed-off-by: FVCproductions <[email protected]>
  • Loading branch information
FVCproductions committed Sep 19, 2016
1 parent 77f47af commit c6f72d4
Show file tree
Hide file tree
Showing 1,751 changed files with 3,851 additions and 316 deletions.
Binary file not shown.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
octocat, squirrel, shipit
Copyright (c) 2012 GitHub Inc. All rights reserved.

bowtie, neckbeard
Copyright (c) 2012 37signals, LLC. All rights reserved.

feelsgood, finnadie, goberserk, godmode, hurtrealbad, rage 1-4, suspect
Copyright (c) 2012 id Software. All rights reserved.

trollface
Copyright (c) 2012 whynne@deviantart. All rights reserved.

All other emoji images
Copyright (c) 2012 Apple Inc. All rights reserved.

All existing code
Copyright 2013 Carlos Galdino

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Search Emoji codes and symbols using Alfred 2

This simple workflow lets you search emoji codes and their symbols.

## Copy the emoji code to use on Campfire, GitHub, etc.
Usage: `emoji [alt key] [query]`

After you hit `enter` the code of the selected emoji will be copied to your
clipboard.

## Copy the actual emoji symbol to use on any OS X app.
Usage: `emoji [query]`

After you hit `enter` the symbol of the selected emoji will be copied to your
clipboard.

## Customizing the keywords:

If you don't like the keywords that are used for triggering the search you can
customize it directly on Alfred. Some suggested using `:` for searching the
emoji code and `emoji` for the actual symbols.

### Last but not least:

* __The `query` argument is optional for both commands. If you don't specify a `query`,
the whole list of emoji will be presented.__

* __You can also search an emoji using related words. Check the full list
[here][related words link]. And also contribute with new words.__

[DOWNLOAD](http://bit.ly/10Azqx2)

![](http://img.carlosgaldino.com/alfred-emoji-workflow_Alfred_2_workflow_for_searching_emoji_codes._2016-01-23_16-14-26.png)

[related words link]:
https://github.com/carlosgaldino/alfred-emoji-workflow/blob/master/related_words.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
require './emoji_symbols'
require './related_words'

def item_xml(options = {})
<<-ITEM
<item arg="#{options[:arg]}" uid="#{options[:uid]}">
<title>#{options[:title]}</title>
<subtitle>#{options[:subtitle]}</subtitle>
<icon>#{options[:path]}</icon>
</item>
ITEM
end

def match?(word, query)
word.match(/#{query.gsub(/\\ /, '').split('').join('.*')}/i)
end

images_path = File.expand_path('../images/emoji', __FILE__)

query = Regexp.escape(ARGV.first).delete(':')

related_matches = RELATED_WORDS.select { |k, v| match?(k, query) || v.any? { |r| match?(r, query) } }

# 1.8.7 returns a [['key', 'value']] instead of a Hash.
related_matches = related_matches.respond_to?(:keys) ? related_matches.keys : related_matches.map(&:first)

image_matches = Dir["#{images_path}/*.png"].map { |fn| File.basename(fn, '.png') }.select { |fn| match?(fn, query) }

matches = image_matches + related_matches

items = matches.uniq.sort.map do |elem|
path = File.join(images_path, "#{elem}.png")
emoji_code = "#{elem}"

emoji = EMOJI_SYMBOLS[elem.to_sym]

item_xml({ :arg => emoji_code, :uid => elem, :path => path, :title => emoji_code,
:subtitle => "Copy \"#{emoji}\" (#{elem}) to clipboard" })
end.join

output = "<?xml version='1.0'?>\n<items>\n#{items}</items>"

puts output
Loading

0 comments on commit c6f72d4

Please sign in to comment.