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
120
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
840
My Open Source Journey
juanitofatas
1
3k
NSDanger
juanitofatas
1
160
How to build deppbot
juanitofatas
3
540
Introducing Danger
juanitofatas
0
270
Twemoji 3.0 in the making and announcement beyond SG50
juanitofatas
0
600
Continuous Updates
juanitofatas
0
120
Ruby Asia and dat bacon cannon
juanitofatas
1
220
Update Early, Update Often
juanitofatas
1
1k
Other Decks in Technology
See All in Technology
Windows Autopilot Deployment by OSD Guy
tamaiyutaro
0
370
いろんなものと両立する Kaggleの向き合い方
go5paopao
2
1.1k
mikroBus HAT を用いた簡易ベアメタル開発
tarotene
0
320
dev 補講: プロダクトセキュリティ / Product security overview
wa6sn
0
1.8k
Terraform CI/CD パイプラインにおける AWS CodeCommit の代替手段
hiyanger
1
190
DMARC 対応の話 - MIXI CTO オフィスアワー #04
bbqallstars
1
140
データの信頼性を支える仕組みと技術
chanyou0311
6
1.7k
株式会社島津製作所_研究開発(集団協業と知的生産)の現場を支える、OSS知識基盤システムの導入
akahane92
1
190
マルチモーダル / AI Agent / LLMOps 3つの技術トレンドで理解するLLMの今後の展望
hirosatogamo
27
7.1k
サイバーセキュリティと認知バイアス:対策の隙を埋める心理学的アプローチ
shumei_ito
0
360
ドメインの本質を掴む / Get the essence of the domain
sinsoku
2
140
Intuneお役立ちツールのご紹介
sukank
3
760
Featured
See All Featured
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
Producing Creativity
orderedlist
PRO
341
39k
YesSQL, Process and Tooling at Scale
rocio
168
14k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.2k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
700
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
7
570
Gamification - CAS2011
davidbonilla
80
5k
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 磷涹