Hacker News new | past | comments | ask | show | jobs | submit | xem's comments login

thanks bro :3


I'm just going through it.

I'm 35, Web Dev since 2009, work from home (2 hours away from work) since 2020, and my company just decided that they want everyone back at the office immediately, or quit.

So I quat. And I decided I'll never be an employee ever again. I'm gonna make a living out of my passions: write a book, create video games, adopt pets, photo, video, and if I run out of money I can still do Web Dev as freelance.

Frightening but also exciting!


When I hear employers present these ultimatums, I always wonder what would happen if you didn't quit but also didn't come into work, simply continued doing your job as before from home. My sense is that many employers are bluffing and would not fire, but I've got not data points.


Yea I'm also im the never again employed camp. Trying to build myself a sustainable solution to this problem of eating and sleeping though.


- Regular Expressions

- Unicode and characters encodings

- Native WebGL

- CSS3D

- Women

I lied about women.


Been coding for ~20 years and I still see coding as an "end" (ie. an interesting goal) even when I'm making apps or games where the code is invisible to the end user


Here's my implementation, also inspired by these videos

It was made in 1kb for the JS1K demo competition: https://js1k.com/2018-coins/demo/3124

Detailed source code: https://github.com/xem/epicycles/blob/gh-pages/index.html

Controls:

- Arrow keys: up / down to change the number of gears, left to toggle intermediate paths, right to clear the scene.

- Mouse: click to add points to the path


I have a few: JavaScript code-golfing; CSS3D art; WebGL (traditional and as in shadertoy); Unicode; 6502 / NES emulation


My solution in 155 chars, vanilla JS

<script>document.write(`<input id=i><a${o=" onclick="}'u.${H="innerHTML"}+="<li${o}${H}=${H}.strike()>"+i.value'>+<a${o}u.${H}="">x</a><ol id=u>`)</script>

Demo: https://codepen.io/xem/pen/dypVzaw?editors=1100

Cheers :)


Awesome What are the $ and H, is it some sort of JQuery? Can you explain :)


The "ungolfed" code looks like this:

<input id=i> <a onclick='u.innerHTML+="<li onclick=innerHTML=innerHTML.strike()>"+i.value'>+ <a onclick=u.innerHTML="">X</a> <ol id=u>

There are 4 occurrences of "innerHTML" and 3 occurrences of " onclick='" so I replaced those two substrings with H and o.

The whole HTML is rendered using an ES6 template literal (document.write(` ... `))

Everytime a ${H} or a ${o} is present in the template, the value of H or o is copied here.

It's a native feature of JS since ES6.

Besides that, the second <a> implicitly closes the first <a>, so no need to use </a>. The id's are global, that's why we can access i.value or u.innerHTML directly. In onclick, "this" (the current element) is implicit. Finally, the strikethrough is done using the (deprecated but still working) .strike() String method.


Hi, Here's my tutorial for going much further than a colored triangle, with very few code too: https://xem.github.io/articles/webgl-guide.html


I've been allowed to continue working from home (at my parents' house) since lockdown and save 800€/month (half of my paycheck) :)


- CSS3D, a fun and easy way to make 3D scenes / games in the browser without WebGL. To my knowledge, we are about 5 people to use it (https://xem.github.io/articles/css3dgames.html)

- JS code-golfing... I'm not alone but we're a small community, who enjoy making JS programs / art / games with the smallest possible amount of code (js1k.com, js13kgames.com, dwitter.net, ...)

- Unicode, its quirks, its updates (not only emoji), its encodings and its predecessors charsets

- Regexes (everyone hates them but I enjoy using them)

- Browsers hacks and polyfills (remember IE6? Firefox 3? Chrome 1? With enough effort, you could make them do almost everything that modern browsers can do today. My job has been to do exactly that for many years, and it was actually pretty fun)


Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: