Hacker News new | ask | show | jobs
by err4nt 3809 days ago
I dunno about others, but I sure do! I have CSS stylesheets in 7 colour themes, a dozen bootstrap-like JS plugins that add common interactive elements I can drop into any site, and tons of parts and pieces of layouts (like an order form, signup form, pricing chart, or media player) isolated and ready to re-use.

I also maintain a big snippets file, filled with HTML, CSS, JS, and command-line snippets and tricks so I can grab them from anywhere.

I dont know how any freelancer or contractor doesnt have a bag of tricks like this.

2 comments

This sounds really helpful. I'm just beginning my contracting. Would you be willing to share these libraries and snippets?
EQCSS is for element queries, scoped CSS, IE8 support, and a whole ton of other goodies - check it out at http://elementqueries.com

Most of the other plugins and things are included in https://github.com/tomhodgins/template-factory

My HTML/CSS/JS/CLI snippets file is located here: https://gist.github.com/tomhodgins/27c29ecb4aceaefe5cdf

My responsive testing tool is located at: https://github.com/tomhodgins/speedtest You can use your keyboard keys 1-0 to test a variety of widths quickly, or use the buttons on mobile to test widths your phone or tablet can't physically emulate

If you're looking for a 'view source' tool for mobile, check out https://github.com/tomhodgins/sourceror It's a simple PHP proxy that loads the requested site and displays it as content on the page. For example, I have it hosted at http://staticresource.com/inspect so I can append a URL after a '?' and see the code formatted nicely. Like http://staticresource.com/inspect/?http://staticresource.com...

You can also check out my CodePen profile, here's my collection of 'Front-end snippets', but I've got plenty more on there you can feel free to use or expand on: http://codepen.io/collection/nNqyvZ/

Hope that sets you off to a good start :)

How do you incorporate this re-use into your contracts?
You could explicitly retain the copyrights on your code. Actually that is the default so in general it's not actually necessary.
I make the stuff and put it under MIT :) Everybody (including me) is free to include it in anything, so long as you don't sue me for having used it.