Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- Code



  HTML Page Slide Without a Framework

The HTML5 Microzone is presented by DZone and Microsoft to bring you the most interesting and relevant content on emerging web standards.  Experience all that the HTML5 Microzone has to offer on our homepage and check out the cutting edge web development tutorials on Script Junkie, Build My Pinned Site, and the HTML5 DevCenter. I'm working on a little demo mobile application for an upcoming project, and I wanted to add sliding transitions between pag...

   HTML,Slide show,No framework,JavaScript     2012-04-17 06:51:40

  Fix could not read Username for 'https://xxx.com': terminal prompts disabled

Recently was working on a project which needed to build a docker image, but unfortunately it kept failing as below error was seen. fatal: could not read Username for 'https://xxx.com': terminal prompts disabled Based on the error, it looked like it was trying to pull code from remote Gitlab repository but failed as the terminal prompt is disabled. At first glance, have a doubt why it needs terminal prompt to be enabled? It should just succeed and without prompting for anything. The only reason...

   GIT,TERMINAL PROMPTS DISABLED,DOCKER     2020-12-13 04:43:12

  Coding skill and the decline of stagnation

I am a decent programmer. I know a decent amount of computer science theory, I can type correct code fairly easy. I don’t let my classes expand too much. But I still struggle some with math, and I have a tendency to have too many cross-dependencies in my code. I used to think I was an awesome programmer. One of the best. After I made a game in the first programming lesson in school, I got told to don’t bother showing up for the rest. I was the one who taught all my friends wh...

   Coding style,SOPA,Stagnation,Decline     2012-01-14 12:05:10

  Mastering Async/Await in JavaScript: A Comprehensive Guide with Examples

As a veteran JavaScript developer, I have seen the evolution of JavaScript's asynchronous programming landscape. From callbacks to promises and now async/await, JavaScript has come a long way in making it easier to handle asynchronous operations in a clean and readable manner. In this article, we will delve into the world of async/await and explore why it has become a popular choice for handling asynchronous operations in JavaScript. We will cover the basics of async/await, its syntax, and how i...

   JAVASCRIPT,COMPARISON,PROMISE,ASYNC AWAIT     2023-02-12 07:26:15

  Run JavaScript in GoLang

In some cases, there might be some JavaScript code needs to be ran in a GoLang project. Fortunately, there are a few libraries which support running JavaScript in GoLang. The most famous one would be v8. This is a Go API for the famous v8 JavaScript engine originally developed for the Chrominum project and the foundation of NodeJS. In this post, we will show some simple steps to get v8 working in a GoLang program on MacOS. First you need to install the package so that you can import it. Run...

   GOLANG,JAVASCRIPT,V8     2019-05-16 07:40:38

  Restore mocked variables in GoLang unit test

One of the guarding principles of writing unit test is that there should be no real external calls for dependant services. Unit test should run by its own and can run without issues on any environment including local, build, test environment. This indicates there should be some mock responses whenever an external call is needed so that different unit test scenarios can be covered. How can this be done in GoLang? In GoLang, anything can be assigned to a variable even including functions. A variab...

   GOLANG,UNIT TEST,MOCK FUNCTION,RESTORE MOCK     2021-12-10 20:43:00

  Extension context menu is missing in Firefox after restart

If you have experience of writing Chrome extension, you may be familiar with how you can add a context menu for your extension. The code would be similar to below: chrome.runtime.onInstalled.addListener(function() { chrome.contextMenus.removeAll(); chrome.contextMenus.create({ "id": "your_id", "title": "Your Title", "contexts": ["all"] }); }); You need to add a listener listening to the extension install event. Once the extension is installed, create a contex...

   CHROME,FIREFOX,EXTENSION,CONTEXT MENU     2018-11-16 20:58:20

  Common usage of ls command in Linux

In Linux, ls might be one of the most frequently used commands. It is used to list files in a specific directory. In most cases, we may just use ls -l to list the files under a directory. But have you explored other usages of this command. In this post, we will summarise some other common usages of ls command Assuming we have below directory structure in our system, let's see them using tree command. List details of the files If we want to list the details of the files in /home/alvin/test_...

   LINUX,SHELL,LS     2018-12-16 03:00:42

  Advanced event registration models

On this page I explain the two advanced event registration models: W3C’s and Microsoft’s. Since neither is cross–browser supported, their use is, for the moment, deprecated. W3C and Microsoft have both developed their own event registration model to replace Netscape’s traditional model. Though I’m not impressed by the Microsoft model, W3C’s is very good, except for one crucial vagueness. Unfortunately few browsers support it at the moment. W3C W3Cââ‚...

   JavaScript,Event model,this,bubble,capturing     2011-12-27 09:20:44

  Ensuring Go Interface Implementation: A Quick Guide

Introduction Go's simplicity and power shine in its interface system, offering a clean way to define contracts between types. However, when it comes to checking whether a struct satisfies an interface, Go's static typing philosophy means there isn't a direct runtime check. In this concise guide, we'll explore practical methods, including some lesser-known tricks, to verify whether a struct implements an interface. Method 1: Type Assertion and a Dummy Method package main import "fmt" type MyInt...

   INTERFACE,GOLANG,IMPLEMENTS     2023-11-25 21:36:01