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
150
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Twemoji RubyGem
Introduce Twemoji RubyGem @ Asakusa.rb
19 May 2015
Juanito Fatas
May 19, 2015
More Decks by Juanito Fatas
See All by Juanito Fatas
Data Migration with Confidence
juanitofatas
3
970
My Open Source Journey
juanitofatas
1
3.3k
NSDanger
juanitofatas
1
190
How to build deppbot
juanitofatas
3
640
Introducing Danger
juanitofatas
0
370
Twemoji 3.0 in the making and announcement beyond SG50
juanitofatas
0
840
Continuous Updates
juanitofatas
0
160
Ruby Asia and dat bacon cannon
juanitofatas
1
280
Update Early, Update Often
juanitofatas
1
1.1k
Other Decks in Technology
See All in Technology
RAGの精度向上とエージェント活用
kintotechdev
2
140
Control Planeで育てるBtoB SaaSの認証基盤 - SRE NEXT 2026
pokohide
1
370
ポストモーテム! DDoSからサイトは守れた。 でもビジネスは守れなかった。
bengo4com
0
410
SRE歴2ヶ月でも開発6年の知見を活かして、チームで止まっていた環境改善を前に進めた話
a_ono
1
210
プロダクトだけじゃない、社内プロセスにおける自動化・省力化ノススメ
kakehashi
PRO
1
540
“ID沼入口” - 基本とセキュリティから始める、考え続けるためのID管理技術勉強会 告知&イントロ
ritou
0
420
背中から、背中へ /paying forward to community
naitosatoshi
0
220
AIに障害切り分けを全部やってもらった。 。 。 。
estie
0
370
プライバシー保護の理論と実践
lycorptech_jp
PRO
1
240
Zoom2Youtube.Claude
kawaguti
PRO
2
430
Empower GenAI with Agile - あなたのアジャイルが生成AIのバフになる仕組み
hageyahhoo
0
130
AI時代における最適なQA組織の作り方
ymty
3
400
Featured
See All Featured
Building Applications with DynamoDB
mza
96
7.1k
Optimizing for Happiness
mojombo
378
71k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.1k
Skip the Path - Find Your Career Trail
mkilby
1
160
Designing Experiences People Love
moore
143
24k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6k
How to Ace a Technical Interview
jacobian
281
24k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
270
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.5k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.4k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
How to Think Like a Performance Engineer
csswizardry
28
2.7k
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 磷涹