Comments (5)
I don't think the content should be in the URL (: Open to loading the settings from URL params.
from carbon.
For example,
const hello = () => {
console.log('Hello World!');
}
(56 chars)
Encodes to:
堗臼铤⋆凃堜曚䙨㫐㖏橯圂Ⴃ㇝荆闌壷䅛鍅Ꮄ榋堑蒠総徖㽈䬥㧰穏
(29 chars)
Just for fun, I also tried encoding the server.js
file (1077 chars). It encodes to:
堗臼铤ᴗ槣濵赆䙽㙹㾜唍㵦価䏕靀飅怙瀪䞌嵖駻盡脾飇圗▯䩎䲗⨫䰉炰䷍帙䀘吤飰祻搙赈䚢帒䒔⫮䵶凱န杄译愔苹䭄鲆ꇃ謕蜢飓夙➊䞌嵖駻盡茪黔㙞湼猎㶖燳㫠甼诘恳炢枬嵖駻盡蜾飔㙞湼⫮䵶傫怰着飏堒茼谬絇埒枝䫨劀㻘⡈㗏档㿁朠㬆闎怚▹Ⰾ衣轣栩蔦诓忷㾛甥譄ꃂ㮽⢜粀㛞疨ᚮ⏆ꇃ篭輲闎㧐✩橤㵇㦻⻕赆哅嶛⦳灊霆䆻怭躠蟐幰㖈㐌緧䞃鋡漪鲀擴棸鑍趗䝃䟅茨鋅㙞湸呮ᑦ憋瞩煂鯅怚㡘听洦凱䛤㩔賕嶑荺呍衧懳᧠眰蟎墖㾜殄═睡ሉ煈鯒嵰⠜猎㤂ᔓ㰌碠掞ᛐ▨ᖍᯖ馃埵誰飅延▼猎売饻᧱洰仅徙▯两═睡ݠ暠䚣帗䌛鏬祆觛䋠瓪碲䍓煨Ⰾ䵢溱ݠ暠ꏉឞ棢犎⎢駣濵蜢飅㩔燽Ⳍ終枡䫀ꄜ䚻ᛐ▸鑍趗䝃珵譌诒㙞湹啮⏆击猀硴⠠㙹羼甬綂騋珴眺闒娐自ᚮ泶騩䋤硴⠠㙹羼甬綂馛㰐皮嗁垗莽ᚥ桢槳㰄纠飅忴湯两ᯗᔁ怩焼諅彴䋙咅桧㥫猐暮嗁垗莽ᚥ㣐皱ݠ蒾䚩奰䋛鑎椢ᔓ㯹漪颀戒综⫬鲲ᒳ瀝肠铅抚Ꮘᖎ岷㧳㰈茮诔㩓爪歅桢槳㰄纠飅忴湯两ᯗᔁ怩焼諅彴䋙咅桧㥫猐暮喇㱐䋙咅起冋灄碲⠊㙐⩋詭鶦榋瀽祆讌㙺䋞䩌㴦䝃䏕躠跉怚Ꮘᖎ岷㧳㰈茮诔㩓烩诤⋆⥳㟱炲⠊㙐⩋詬㵆潣㯹潀闉嶚䌂橤⏖凳翵誼雏怚⠉豎淖爃矵誮劀垗罾偬㵧䅫漙筆闎㩽湻ⴍ糷䠑ݼ鄺袇㙾炫ᖎ䲗⨫䰉炰䵮㷴㺛狭沷㧙搱锲體夙➊䭡䛢Ⴃ珵譌诒㵶䂜铬終槣搩躸䚥徙▯两═睡ݠ朲貀㩲苼殄␆槳搼未飒ᛐ▨ᖌ嵖駻搑炼鋏姴㹏橪䲖⤣諡蔼䚨悚䉎汅鴦ꆻᦑ眾駔䍒䔜㐮䶇酡䩨暠ꏉឞ炢ɿ
(539 chars)
from carbon.
I think the only issue with this is mainly the length of the code – we've only got 2048 characters to work with, minus the theme. One thing we could do is use base32768 to shorten that code significantly, but it leads to ugly-looking URLs.
from carbon.
Yeah, that's right although I think 2048 characters would be an edge case here. Perhaps we could have a permalink button that automatically creates a Gist from the code if it was more than 2048 chars.
Alternatively, we could enable this functionality only on links with a Gist ID and not have the content in the URL.
from carbon.
How would this interact with loading & saving the settings from local storage?
I wouldn't want my settings to be reset, just because I clicked a link with pre-configured settings.
On the other hand I might want to persist the shared settings. 🤔
from carbon.
Related Issues (20)
- Jupyter Notebook Frame/Style
- Single \n (empty line) is being ignored!
- Improve Documentation on how to add a new Language
- Migration to TS
- Fix #1405 for image cutoff breaks Chrome, Brave on Mac and older Safari
- Drop shadow preview does not match export (Safari 16.5.1)
- Syntax highlighting support for Microsoft Dynamics Business Central AL language.
- Incorrect final line padding
- Carbon app is not running locally HOT 2
- Auto-paste from Clipboard
- URL does not contain information about custom formatting (e.g. coloring)
- Markdown support with option to remove markdown characters
- Diff command support
- Unified diff output broken for some theme presets HOT 1
- Save not updating existing snippets HOT 3
- Formatting issue HOT 3
- Screenshot formatting is broken for hanging indent code HOT 2
- Cursor not visible with dark background HOT 2
- Feature request: increase spacing between line numbers and code HOT 2
- feature request: add new GitHub Monaspace font to font-selection
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from carbon.