Skip to content

Content Tagged "js"

Page 1 of 1

Content Tagged "js"

Draw Graphs with JSON Data

February 3, 2019Categories: Software, Tutorial
Previous post dealt with sending JSON data around. Now, I need to be able to draw it. After looking for graphing libraries, I've settled on Chart.js and on CanvasJS . Common steps All graphs need a canvas element to function: First thing I wanted, was to get the data with AJAX. This way, my…

Send JSON Graph Data from Django

February 3, 2019Categories: Software, Tutorial
I'm trying to write a Django application to deal with my finances. I've got a nice page listing various transactions, but I thought it'd be nice to have a graph too, to see where I actually am on the spot. To do this, I'll need two components: A JSON sender from Django A receiver and renderer on the…

Ignore ESLint Directives in Code

January 18, 2018Categories: Software, Tutorial
The other day I've had to refactor a piece of angular code. Unfortunately, the original code was written a long time ago and has some issues like having $scope in controllers and a rather large number of unused variables. changing the $scope to this is a very time-consuming task as it implies…

Load FontAwesome Fonts with Webpack 2

January 23, 2017Category: Software
TL;DR: : Add the (s)css dependency to your main (s)css file and specify where to find the fonts too. Then use the proper loaders in your webpack.config.js file. The past few days I had trouble loading the font-awesome fonts with webpack. I tried quite a few solutions: Using the font-awesome-sass…

Change Packages Paths in NodeJS

November 25, 2016Categories: Software, Tutorial
TL;DR: Edit %appdata%\npm\etc\npmrc and add prefix and cache entries to specify the locations where node puts packages. Every time I install a new framework/dev environment I have to look where they put files. Having a roaming profile is a pain and I need to make sure it doesn't get too…

Debug Javascript - Some Methods

November 17, 2016Category: Software
These days I'm trying to tweak a 3rd-party framework and I'm missing stuff sometimes (e.g. injected data). Below are some methods I've found useful when debugging the script. console.log - print all things Object inspection - see your object's content HTH,

Debug Javascript - Object Inspection

November 17, 2016Category: Software
Many times, you have objects where you may or may not know their content. If you're running in the browser, life is easy as you can pause the code and inspect the object. at command line is a bit more annoying. In this case, at least for the first run, you can execute something like: where obj is…

Debug Javascript - console.log

November 17, 2016Category: Software
This is the holy grail of debugging for me. It's old school, simple and effective. It works both in browser and from command line. My code looks like: You can make it fancier with debug levels (in if() statements or with your tiny library). I however tend to add/remove them progressively as I…

Drawing QR-Code on Browser in Javascript

May 2, 2014Category: Software
In my quest to make the pages of one site a bit more mobile-friendly, I've got the idea to provide a QR-Code for an unique identifier generated for users. This is part of a wizard and the end-product is: QR Code in JavaScript To reach this outcome, I've started by looking for a QR javascript snippet…

Copy Text to Clipboard in HTML Page using JavaScript

May 1, 2014Category: Software
I've got a problem on one of my sites: I have a unique identifier displayed on one page, which I need to make it easy After looking online, I've found three approaches using only JS. Clipboard.js Clipboard.js is a new (September 2015) approach which uses only JS to copy the text transparently…

All tags