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
870
My Open Source Journey
juanitofatas
1
3k
NSDanger
juanitofatas
1
160
How to build deppbot
juanitofatas
3
560
Introducing Danger
juanitofatas
0
280
Twemoji 3.0 in the making and announcement beyond SG50
juanitofatas
0
650
Continuous Updates
juanitofatas
0
120
Ruby Asia and dat bacon cannon
juanitofatas
1
240
Update Early, Update Often
juanitofatas
1
1k
Other Decks in Technology
See All in Technology
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
6
57k
2025-02-21 ゆるSRE勉強会 Enhancing SRE Using AI
yoshiiryo1
1
240
『衛星データ利用の方々にとって近いようで触れる機会のなさそうな小話 ~ 衛星搭載ソフトウェアと衛星運用ソフトウェア (実物) を動かしながらわいわいする編 ~』 @日本衛星データコミニティ勉強会
meltingrabbit
0
140
AndroidXR 開発ツールごとの できることできないこと
donabe3
0
130
30分でわかる『アジャイルデータモデリング』
hanon52_
9
2.6k
急成長する企業で作った、エンジニアが輝ける制度/ 20250214 Rinto Ikenoue
shift_evolve
3
1.3k
目の前の仕事と向き合うことで成長できる - 仕事とスキルを広げる / Every little bit counts
soudai
24
7k
クラウドサービス事業者におけるOSS
tagomoris
1
510
SA Night #2 FinatextのSA思想/SA Night #2 Finatext session
satoshiimai
1
140
【Developers Summit 2025】プロダクトエンジニアから学ぶ、 ユーザーにより高い価値を届ける技術
niwatakeru
2
1.4k
ユーザーストーリーマッピングから始めるアジャイルチームと並走するQA / Starting QA with User Story Mapping
katawara
0
200
TAMとre:Capセキュリティ編 〜拡張脅威検出デモを添えて〜
fujiihda
2
240
Featured
See All Featured
Into the Great Unknown - MozCon
thekraken
35
1.6k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.4k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.7k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
4
410
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
9
440
Automating Front-end Workflow
addyosmani
1368
200k
Bash Introduction
62gerente
611
210k
Building an army of robots
kneath
303
45k
It's Worth the Effort
3n
184
28k
Making Projects Easy
brettharned
116
6k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
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 磷涹