Better HN
topnewbestaskshowjobs
Log inSign up

Existenceblinks

1,102 karma · joined Jun 12, 2015 (11y ago) · 1,205 submissions

Submissions

comment 9y ago · link · parent

Embedded systems - Wireless Sensors Networks, I know it has been there for long time but IoT would encourage it more. It could enable development of different kinds of devices as well. Look at camera industry for example. There should be more types of sensor to be more popular than just the image sensor. Quadcopter/Drone/AI etc.

In my view, there are still a huge room of applications where wireless and sensor combined, and we already have web/native platforms. This is so exciting development!

comment 11y ago · link · parent

I didn't compare the results between Purifycss and this bash script[1] yet. But this alternative, not intent to compete, does mainly the same detection e.g. including dynamic class adding detection.

1: https://gist.github.com/50kudos/3028fac585eda85aea9a

comment 11y ago · link · parent

Though you need to manually visit all those pages. And it wouldn't be easy to traverse DOM with those server side logic/condition.

IMHO, do it offline and out of browser would be easier. But I also think doing it directly with the codes can be hard too since there are so many way that those css will be added to templates.

comment 11y ago · link · parent

I might be wrong but I'm glad to see you try using this REGEX https://news.ycombinator.com/item?id=9708629

comment 11y ago · link · parent

I _think_ it shouldn't be too much code. For my rails project, I wrote a simple shell script[1] to get all unused css classes and remove it my hand in final step, to make sure i will not remove css classes that actually used (e.g pre-define and use in future, overriding of third party css class)

The script basically does:

1. Use REGEX match all css classes, `cat` into one place

2. Read the class line by line and search in html,js files to see if this css is used (even support #addClass from js)

2.1 it also supports several class adding styles e.g. class="abc", class: "abc", :class=> 'abc' or even "xxx" class in this: class="abc xxx ijk"

2.2 People even do this in js: $modal.append($('<div class="modal-close-icon"></div>')); and the REGEX can also detect this lol.

[1] https://gist.github.com/50kudos/3028fac585eda85aea9a

You can adapt my REGEX, and custom your directory where those css files are in.

Simply copy the code and save into your filename.sh, and can run safely because my script don't write any file of your project.

1
3738394041