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
3年でバックエンドエンジニアが5倍に増えても破綻しなかったアーキテクチャ そして、これから / Software architecture that scales even with a 5x increase in backend engineers in 3 years
euglena1215
11
4.3k
Alignment and Autonomy in Cybozu - 300人の開発組織でアラインメントと自律性を両立させるアジャイルな組織運営 / RSGT2025
ama_ch
1
2.1k
comilioとCloudflare、そして未来へと向けて
oliver_diary
5
380
.NET 最新アップデート ~ AI とクラウド時代のアプリモダナイゼーション
chack411
0
160
Formal Development of Operating Systems in Rust
riru
1
400
深層学習と3Dキャプチャ・3Dモデル生成(土木学会応用力学委員会 応用数理・AIセミナー)
pfn
PRO
0
430
「完全に理解したTalk」完全に理解した
segavvy
1
280
能動的ドメイン名ライフサイクル管理のすゝめ / Practice on Active Domain Name Lifecycle Management
nttcom
0
340
最近のSfM手法まとめ - COLMAP / GLOMAPを中心に -
kwchrk
8
1.8k
Oracle Exadata Database Service(Dedicated Infrastructure):サービス概要のご紹介
oracle4engineer
PRO
0
12k
機械学習を「社会実装」するということ 2025年版 / Social Implementation of Machine Learning 2025 Version
moepy_stats
3
420
WantedlyでのKotlin Multiplatformの導入と課題 / Kotlin Multiplatform Implementation and Challenges at Wantedly
kubode
0
170
Featured
See All Featured
How to Think Like a Performance Engineer
csswizardry
22
1.3k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Designing for Performance
lara
604
68k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
18k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.2k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
Statistics for Hackers
jakevdp
797
220k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
The Invisible Side of Design
smashingmag
299
50k
A designer walks into a library…
pauljervisheath
205
24k
GraphQLとの向き合い方2022年版
quramy
44
13k
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 磷涹