Code Monkey home page Code Monkey logo

Comments (5)

mfix22 avatar mfix22 commented on May 22, 2024 3

I don't think the content should be in the URL (: Open to loading the settings from URL params.

from carbon.

andrewda avatar andrewda commented on May 22, 2024 2

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.

andrewda avatar andrewda commented on May 22, 2024

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.

jgierer12 avatar jgierer12 commented on May 22, 2024

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.

zcei avatar zcei commented on May 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.