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
880
My Open Source Journey
juanitofatas
1
3.1k
NSDanger
juanitofatas
1
170
How to build deppbot
juanitofatas
3
570
Introducing Danger
juanitofatas
0
300
Twemoji 3.0 in the making and announcement beyond SG50
juanitofatas
0
670
Continuous Updates
juanitofatas
0
130
Ruby Asia and dat bacon cannon
juanitofatas
1
250
Update Early, Update Often
juanitofatas
1
1k
Other Decks in Technology
See All in Technology
Symfony in 2025: Scaling to 0
fabpot
2
170
お問い合わせ対応の改善取り組みとその進め方
masartz
1
350
バックエンドエンジニアによるフロントエンドテスト拡充の具体的手法
kinosuke01
1
640
大規模アジャイル開発のリアル!コミュニケーション×進捗管理×高品質
findy_eventslides
0
460
Keynote - KCD Brazil - Platform Engineering on K8s (portuguese)
salaboy
0
120
移行できそうでやりきれなかった 10年超えのシステムを葬るための戦略 / phper-kaigi-2025-ryu
carta_engineering
0
680
技術好きなエンジニアが _リーダーへの進化_ によって得たものと失ったもの / The Gains and Losses of a Tech-Enthusiast Engineer’s “Evolution into Leadership”
kaminashi
0
200
AIエージェントキャッチアップと論文リサーチ
os1ma
6
1.2k
モノリスの認知負荷に立ち向かう、コードの所有者という思想と現実
kzkmaeda
0
110
製造業の会計システムをDDDで開発した話
caddi_eng
3
930
SpannerとAurora DSQLの同時実行制御の違いに想いを馳せる
masakikato5
0
560
コンソールで学ぶ!AWS CodePipelineの機能とオプション
umekou
2
110
Featured
See All Featured
GraphQLとの向き合い方2022年版
quramy
45
14k
Building a Modern Day E-commerce SEO Strategy
aleyda
39
7.2k
Into the Great Unknown - MozCon
thekraken
36
1.7k
Faster Mobile Websites
deanohume
306
31k
Unsuck your backbone
ammeep
670
57k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
40
2k
Visualization
eitanlees
146
15k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.7k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
7
610
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
12k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
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 磷涹