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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Juanito Fatas
May 19, 2015
Technology
0
140
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
940
My Open Source Journey
juanitofatas
1
3.2k
NSDanger
juanitofatas
1
180
How to build deppbot
juanitofatas
3
610
Introducing Danger
juanitofatas
0
350
Twemoji 3.0 in the making and announcement beyond SG50
juanitofatas
0
780
Continuous Updates
juanitofatas
0
150
Ruby Asia and dat bacon cannon
juanitofatas
1
270
Update Early, Update Often
juanitofatas
1
1.1k
Other Decks in Technology
See All in Technology
AWS Devops Agent ~ 自動調査とSlack統合をやってみた! ~
kubomasataka
2
250
ドメイン駆動セキュリティへの道しるべ
pandayumi
0
180
【Oracle Cloud ウェビナー】[Oracle AI Database + Azure] AI-Ready データ戦略の最短ルート:Azure AIでビジネス データの価値を最大化
oracle4engineer
PRO
2
130
VRTと真面目に向き合う
hiragram
1
500
Claude in Chromeで始める自律的フロントエンド開発
diggymo
1
280
新規事業における「一部だけどコア」な AI精度改善の優先順位づけ
zerebom
0
360
BPaaSオペレーション・kubell社内 n8n活用による効率化検証事例紹介
kubell_hr
0
350
BiDiってなんだ?
tomorrowkey
2
500
入社1ヶ月でデータパイプライン講座を作った話
waiwai2111
1
110
あたらしい上流工程の形。 0日導入からはじめるAI駆動PM
kumaiu
1
270
re:Inventで出たインフラエンジニアが嬉しかったアップデート
nagisa53
4
220
Azure SQL Databaseでベクター検索を活用しよう
nakasho
0
120
Featured
See All Featured
The Invisible Side of Design
smashingmag
302
51k
The Language of Interfaces
destraynor
162
26k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
How STYLIGHT went responsive
nonsquared
100
6k
Producing Creativity
orderedlist
PRO
348
40k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Agile that works and the tools we love
rasmusluckow
331
21k
So, you think you're a good person
axbom
PRO
2
1.9k
Everyday Curiosity
cassininazir
0
120
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.6k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
82
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 磷涹