Skip to content

Instantly share code, notes, and snippets.

@luisfcorreia
Last active March 16, 2020 14:45
Show Gist options
  • Save luisfcorreia/b986c114f731bbecb351507693a54683 to your computer and use it in GitHub Desktop.
Save luisfcorreia/b986c114f731bbecb351507693a54683 to your computer and use it in GitHub Desktop.
function f(a,c,d){return d=d.split("").filter(c=>a.includes(c)),i=0,l=a.length,c?d.map(d=>(b=c[i++%c.length],a[(a.indexOf(b)-a.indexOf(d)+l)%l])).join(""):d.join("")}
f=(a,c,d)=>{return d=d.split("").filter(c=>a.includes(c)),i=0,l=a.length,c?d.map(d=>(b=c[i++%c.length],a[(a.indexOf(b)-a.indexOf(d)+l)%l])).join(""):d.join("")}
f=(e,a,c)=>(c=c.split("").filter(a=>e.includes(a)),i=0,l=e.length,a?c.map(c=>(b=a[i++%a.length],e[(e.indexOf(b)-e.indexOf(c)+l)%l])).join(""):c.join(""))
f=(a,k,t)=>(t=[...t].filter(k=>a.includes(k)),i=0,l=a.length,k?t.map(t=>(b=k[i++%k.length],a[(a.indexOf(b)-a.indexOf(t)+l)%l])).join(""):t.join(""))
f=(a,k,t)=>(o=0,t.replace(/./g,m=>(l=a.length,a.includes(m)?k?a[(a.indexOf(b=k[o++%k.length])-a.indexOf(m)+l)%l]:m:'')))
f=(a,k,t)=>(o=0,t.replace(/./g,m=>(l=a.length,(z=a.indexOf(m))>-1?k?a[(a.indexOf(b=k[o++%k.length])-z+l)%l]:m:'')))
f=(a,k,t)=>(o=0,t.replace(/./g,m=>(l=a.length,(z=a.indexOf(m))>-1?k?a[(a.indexOf(k[o++%k.length])-z+l)%l]:m:'')))
f=(a,k,t,o=0,l=a.length)=>t.replace(/./g,m=>((z=a.indexOf(m))>-1?k?a[(a.indexOf(k[o++%k.length])-z+l)%l]:m:''))
f=(a,k,t,o=0,l=a.length)=>t.replace(/./g,m=>((z=a.indexOf(m))<0?'':k?a[(a.indexOf(k[o++%k.length])-z+l)%l]:m))
f=(a,k,t,o=0,l=a.length)=>t.replace(/./g,m=>(~(z=a.indexOf(m))?k?a[(a.indexOf(k[o++%k.length])-z+l)%l]:m:''))
f=(a,k,t,o=0,l=a.length)=>t.replace(/./g,m=>~(z=a.indexOf(m))?k?a[(a.indexOf(k[o++%k.length])-z+l)%l]:m:'')
f=(a,k,t,o=0,l=a.length)=>t.replace(/./g,m=>~(z=a.indexOf(m))?k?a[(a.search(k[o++%k.length])-z+l)%l]:m:'')
f=(a,k,t,o=0,r=a+a)=>t.replace(/./g,m=>~(z=a.indexOf(m))?k?r[r.indexOf(k[o++%k.length],z)-z]:m:'')
f=(a,k,t,o=0)=>t.replace(/./g,m=>~(z=a.indexOf(m))?k?a[(a+a).indexOf(k[o++%k.length],z)-z]:m:'')
f=(a,k,t,o=0)=>t.replace(/./g,m=>~(z=a.indexOf(m))?a[(a+a).indexOf(k[o++%k.length],z)-z]||m:'')
f=(a,k,t,o=w='')=>t.replace(/./g,m=>~(z=a.indexOf(m))?a[(a+a).indexOf((w+=k)[o++],z)-z]||m:'')
f=(a,k,t,o=w=1)=>t.replace(/./g,m=>~(z=a.indexOf(m))?a[(a+a).indexOf((w+=k)[o++],z)-z]||m:'')
working
submitted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment