Gulp - fix to high CPU usage

TL;DR gulp.task('default', ['server'], function() { livereload.listen(); gulp.watch(['path/to/sass/*.scss'], { interval: 500 }, ['style']); #larger intervals on style tasks gulp.watch(['path/to/views/*.html'],{ interval: 500 }, ['template']); #larger intervals on template gulp.watch(['path/to/js/*.js'],{ interval: 500 }, ['hinting','test']); }); I noticed surge in…

JS dead code

Dead code is a code that is not being used. By code, I mean functions, classes and libraries that are not used anymore. Finding dead JavaScript code Fixmyjs Forum on the question…

re-size background image

Two sources were used for this tip. CSS background image to fit width, height should auto-scale in proportion Mozilla about background-size body { overflow-y: hidden ! important; overflow-x: hidden ! important; background-color: #f8f8f8; background-image: url('index.png'); /*background-size: cover;*/ background-size: contain; background-repeat: no-repeat; background-position: right; } For a full background image, the following code…

How to read a textbook

Reading a Textbook for True Understanding 4 Steps to Reading a Textbook Quickly and Effectively Tips for reading CS textbooks Active reading strategies - Princeton University…

around the web

Things I/You may read now and then reconsider maker-vs-manager Where do These People Get Their (Unoriginal) Ideas? Sell your originals Marketplace Business Model What is code 10 Must-Read Articles On Running A Two-Sided Marketplace Startup Stuart Hall author of this medium and creator of appbot.co Brave New Geek…

mistakes

A story of my first software failure experience One night in 2008, I started working on what I thought was going to be an easy to use, one stop-shop software that would disrupt property management industry, make even happier both property managers and their customers, myself included! For over than…

deployment automation

Abstract This post is for my personal use. It is a work in progress, and will change as new ideas or challenges yield. Most of code come from other blog posts, documentations or Question/Answer websites. Links are provided at end of the page. Viable solutions I am exploring in…

npm - task automation

I have a biased point of view when it comes to task runners a.k.a automation tools. Gulp rule them all. Few days ago though, while digging into CPU overload caused by watch utillity, I stumbled upon blog posts exposing other alternatives. One of them was to use npm…

git tips

This blog post is personal reference to some git ressources I don't want to forget. Successfull Git Branching - A blog post that makes sense! It discusses HOW to do branching. 19 Git tips for Everyday user - Or "19 git tips your Grandpa can't agree more." Git Commit -…

Photo hosting for developers

I spend last week searching for photo a hosting service for developers, and ended up using none of them. I always tend to build things that needed to be built, and out-sourcing everything else. It helps to move things fast, well, sometimes. I just wanted something simple, a service that…

JavaScript tips

Here is some tips and tricks I use quite often. Capitalize fist character in a string/sentence Getting initals of a name. First method uses regex, and the second method uses split(),join() and map() 'George Washington'.replace(/\W*(\w)\w*/g, '$1').toUpperCase(); 'Abraham Lincoln'.split(' ')…

success stories

Kick-ass, crazy ideas and overnight success stories I built, launched, and got paying customers for my side project in 3 hours.Here’s what I learned…

mongoose tips and hacks

How to query an embedded document can be found on SO also. #with a premise that you sent an email and zip User.find({ email : req.body.email, 'address.zip' : req.body.zip #this is the "thing" }, function(err, docs){ #more code with documents }); Query with a "non-equivalent", "and" operations…

css - performance

Rules for a performant CSS code CSS is interpreted from right to left. Performance degrades from ID to Class to Universal selectors. To achieve better performance, I compiled following key points from various sources(links are available in reference section) Rule 1. Remove universal selectors * { /**style instructions here*/ } /**bad*/ .style-instruction{…

Eclipse tricks and tips

How to un-install a plugin from eclipse Goto Help About Eclipse SDK Installation Details Installed Software Tab Select a plug-in you want to Uninstall Click Uninstall button at the bottom How to compare two files can be found at SO. How to change the case for a string? more on…

nginx redirection

The index page(hoo.gy) was initially rolled out in earlier days of the product to tell visitors what the product was all about. After the app matured enough, there were no reason to keep it there, with an overhead of maintenance on each release. I therefore decided to make…

Mac/Linux tips

To kill node(other background tasks) $ ps aux | grep node #lists node instances with their PID $ sudo killall node #in case we want to kill all node instances $ sudo kill -9 `ps aux | grep node | tail -1 | awk '{print $2}'` $ sudo purge #to free up un-used memory on…