Quantcast
Channel: Have Fun Learning
Browsing all 119 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

Angular: Requiring ng-model as Component

To turn a custom component of an input element into a ng-model/validation enabled one, and to be able to use NgModelController and all its fancy methods in its controller: Use the require syntax as...

View Article



Image may be NSFW.
Clik here to view.

NPM: ERRORINUSE

For error: Error: listen EADDRINUSE :::3042 We just need to kill whatever that’s on the port. Probably the last exit wasn’t clean. Do: $ lsof -i :3000 // to find out the PID number $ kill -9 // kill...

View Article

Image may be NSFW.
Clik here to view.

Reduce Webpack Style Loader Runtime

If you @import a lot of scss/sass/css files, the style loader can take a looong time to finish loading. How to improve? Lets take a look at what each of them does: raw-loader: loads files in as string...

View Article

Image may be NSFW.
Clik here to view.

How to: Prevent Body From Scrolling

After I accidentally stumbled upon the solution to “preventing body scrolling when overlay is on” by trying too many different things again and again, I wasn’t able to explain exactly why this works....

View Article

Image may be NSFW.
Clik here to view.

Module parse failed with HTML template

Error: Module parse failed: <...> You may need an appropriate loader to handle this file type. Check your webpack loader, either html loader or raw-loader, whichever one you’re using. There might...

View Article


Image may be NSFW.
Clik here to view.

Reference: Import & Export

Difference between: Export Import export = foo; import foo = require("./file"); // deprecated export default foo; import foo from "./file"; export foo; or: export {foo}; import {foo} from "./file";...

View Article

Image may be NSFW.
Clik here to view.

Creating & Applying Git Patches

Create: $ git diff > file_name.diff Apply: $ git apply file_name.diff It’s just a text file, so the extension can be anything, diff, patch, or nothing. The important thing is the file itself, not...

View Article

Image may be NSFW.
Clik here to view.

“Angular” Sanitize

We don’t actually need $sanitize to sanitize strings. ng-bind automatically implements sanitizing in the background with textContent. However, sometimes we need to pass string in as template in...

View Article


Image may be NSFW.
Clik here to view.

Kendo Grid Sort: Arrow Not Appearing

This is an easy gotcha: For sortable columns to appear sortable and clickable, we need to configure the “field” parameter of a column. Because: columns.sortable: If set to true the user can click the...

View Article


Image may be NSFW.
Clik here to view.

Git Commit Weirdness

Sometimes when we pull from upstream origin in terminal, we see git prompting to enter vim. And if we left it hanging there and went ahead committing somewhere else, it would treat all those changes in...

View Article

Image may be NSFW.
Clik here to view.

Angular Testing: Understanding $componentConstructor

Angular testing can be confusing. To make it less confusing, lets talk about a major part: $componentController. First, what is necessary when setting up a test? Say that we have this as component...

View Article

Image may be NSFW.
Clik here to view.

Deferring Execution in JavaScript

For people who use Angular, calling $timeout(fn) without a second parameter is a very familiar way of deferring execution. But what about in plain JavaScript?   FIRST. setTimeout() In much the same...

View Article

Image may be NSFW.
Clik here to view.

You have to install development tools first.

That was a very vague error message when installing certain gems. What we need to do is: Either: Install Xcode dev tools; Open up Xcode app and Agree to the License.

View Article


Image may be NSFW.
Clik here to view.

What Happens Pre Talk

Panic, that’s what happens. When Terry mentioned that there was a last minute spot for speaking at Confoo and asked for volunteers, I thought, com’on, you can do this. Just press that damn “Send...

View Article

Image may be NSFW.
Clik here to view.

Links: Front End Performance Optimisation

Where to find: Slides*: https://goo.gl/Bt6uA5 Blog: http://luxiyalu.com Email: luxiyalu@foxmail.com Git: https://github.com/Luxiyalu *All the references of the talk are in the Author’s note part under...

View Article


Image may be NSFW.
Clik here to view.

Weird Focus Behavior Involving Label

Today I had one of the weirdest bugs of the year. With kendo combobox, whenever a dropdown arrow is clicked, the dropdown would roll up immediately and page would automatically focus on another input....

View Article

Image may be NSFW.
Clik here to view.

JavaScript Testing: How to Mock Static Variables

When we have $ctrl created by $componentController, how to mock static members of a class? let $ctrl = $componentController("funny-component", null); Either: The Ugly Way...

View Article


Image may be NSFW.
Clik here to view.

Reference: How to Git Stash

To save the uncommitted changes: # Either without a name $ git stash # Or with a stash name: $ git stash save funny-stash   To see the list of stashes in your git: $ git stash list # Returning a list...

View Article

Image may be NSFW.
Clik here to view.

“Find Your Passion”

Kevin Kelly: Don’t try to find your passion. Instead master some skill, interest, or knowledge that others find valuable. It almost doesn’t matter what it is at the start. You don’t have to love it,...

View Article

Image may be NSFW.
Clik here to view.

Can’t Login to WordPress wp-admin after Change of URL

Steps to change site URL without visual login panel: Step 1: SSH Log into The Site local$ ssh username@ip-address Step 2: Edit Configuration Manually server$ nano path-to-wordpress/wp-config.php (In...

View Article
Browsing all 119 articles
Browse latest View live




Latest Images