Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Twemoji RubyGem
Search
Juanito Fatas
May 19, 2015
Technology
0
130
Twemoji RubyGem
Introduce Twemoji RubyGem @ Asakusa.rb
19 May 2015
Juanito Fatas
May 19, 2015
Tweet
Share
More Decks by Juanito Fatas
See All by Juanito Fatas
Data Migration with Confidence
juanitofatas
3
860
My Open Source Journey
juanitofatas
1
3k
NSDanger
juanitofatas
1
160
How to build deppbot
juanitofatas
3
550
Introducing Danger
juanitofatas
0
280
Twemoji 3.0 in the making and announcement beyond SG50
juanitofatas
0
640
Continuous Updates
juanitofatas
0
120
Ruby Asia and dat bacon cannon
juanitofatas
1
230
Update Early, Update Often
juanitofatas
1
1k
Other Decks in Technology
See All in Technology
I could be Wrong!! - Learning from Agile Experts
kawaguti
PRO
8
3k
20241125 - AI 繪圖實戰魔法工作坊 @ 實踐大學
dpys
1
450
三菱電機で社内コミュニティを立ち上げた話
kurebayashi
1
320
2025年のARグラスの潮流
kotauchisunsun
0
730
EMConf JP の楽しみ方 / How to enjoy EMConf JP
pauli
2
120
アジャイルチームが変化し続けるための組織文化とマネジメント・アプローチ / Agile management that enables ever-changing teams
kakehashi
3
3k
テストを書かないためのテスト/ Tests for not writing tests
sinsoku
1
160
いまからでも遅くないコンテナ座学
nomu
0
210
.NET AspireでAzure Functionsやクラウドリソースを統合する
tsubakimoto_s
0
150
ゼロからわかる!!AWSの構成図を書いてみようワークショップ 問題&解答解説 #デッカイギ #羽田デッカイギおつ
_mossann_t
0
1.2k
Accessibility Inspectorを活用した アプリのアクセシビリティ向上方法
hinakko
0
140
コロプラのオンボーディングを採用から語りたい
colopl
5
540
Featured
See All Featured
Writing Fast Ruby
sferik
628
61k
Producing Creativity
orderedlist
PRO
343
39k
Docker and Python
trallard
43
3.2k
Music & Morning Musume
bryan
46
6.3k
Fashionably flexible responsive web design (full day workshop)
malarkey
406
66k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Navigating Team Friction
lara
183
15k
Measuring & Analyzing Core Web Vitals
bluesmoon
5
200
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
Optimising Largest Contentful Paint
csswizardry
33
3k
The Language of Interfaces
destraynor
155
24k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
Transcript
6YGOQLK
,WCPKVQ(CVCU !
@JuanitoFatas
@JuanitoFatas
@JuanitoFatas
@JuanitoFatas
Jolly Good Code !winstonyw
None
闦闇闕阒陎阇阸閥陆
6YKVVGT'OQLK
JVVRUVYGOQLKOCZEFPEQO
None
None
JVVRUIKVJWDEQOLQNN[IQQFEQFGVYGOQLK
6YGOQLKRCTUGňJGCTVAG[GUʼn 6YGOQLKRCTUG KOI ENCUUŅGOQLK FTCIICDNGŅHCNUG VKVNGŅJGCTVAG[GU CNVŅ
UTEŅJVVRUVYGOQLKOCZEFPEQOZHFRPI
20)ZZZ https://twemoji.maxcdn.com/72x72/1f60d.png https://twemoji.maxcdn.com/36x36/1f60d.png https://twemoji.maxcdn.com/16x16/1f60d.png
58)
6YGOQLKRCTUGQRVKQPU Twemoji.configure do |config| config.asset_root = "https://twemoji.awesomecdn.com/" config.file_ext = ".svg"
config.image_size = nil # only png need to set size config.class_name = "twemoji" config.img_attr = "style='height: 1.3em;'" end
#XCKNCDNGCU4CKNU*GNRGT module EmojiHelper def emojify(content, **options) return if content.blank? Twemoji.parse(h(content),
options).html_safe end end
'4DXKGY <%= emojify "I like chocolate :heart_eyes:!”, image_size: "36x36" %>
$WVYGNKMG*CON %= emojify "I like chocolate :heart_eyes:!", image_size: "36x36"
1T*CONYKVJQWV UNKO = emojify "I like chocolate :heart_eyes:!", image_size:
"36x36" 5QTT[/CVUWFC閽闻
*6/.2KRGNKPG JVVRUIKVJWDEQOLEJJVONRKRGNKPG
%QPVGPV =/CTMFQYP(KNVGT? /CTMFQYP
%JCKPQH(KNVGTU
None
⬅️⬅️⬅️
+PVGTITCVGYKVJ*6/.2KRGNKPG module HTML class Pipeline module Twitter class EmojiFilter <
HTML::Pipeline::Filter def call Twemoji.parse(doc) end end end end end
+PVGTITCVGYKVJ*6/.2KRGNKPG module MarkdownHelper def markdown_to_html(post, **options) pipeline = HTML::Pipeline.new [
HTML::Pipeline::SanitizationFilter, HTML::Pipeline::Twitter::EmojiFilter, HTML::Pipeline::RougeFilter, ], { gfm: true, mentions: post.mentions, post: post, **options } pipeline.call(post.body)[:output].to_s.html_safe end end
/C[6JG6YGOQLK $G9KVJ[QW
閼㖼㉦閬闇闈閵 閪闲閴闐閮閼閾閬闦闁猳
#UCMWUCTD 磷涹