Maven project can be easily created using built-in plugins from the popular IDEs such as Eclipse and IntelliJ IDEA. However, in scenarios where you don't or cannot use IDE, we can also create a maven project from the Maven native command line without using any IDE. In this article we would create a simple Java project using Maven command line with and without archetype.
| // Author: |7eter l-|. l3oling | |
| // License: MIT | |
| // Copyright: 2024 | |
| // See: https://gist.github.com/pboling/f831235a1f3c5627f0341c4bbcf37ea9 | |
| // Inspired by https://gist.github.com/RavenHursT/1dd87fb3460183b02ed1cf1dba065de8 | |
| /* | |
| Usage: | |
| 1. Add pre-requisites: |
| import { useEffect } from "react"; | |
| import { useLocation } from "react-router-dom"; | |
| export const usePageTracking = () => { | |
| const location = useLocation(); | |
| useEffect(() => { | |
| window.gtag("event", "page_view", { | |
| page_path: location.pathname + location.search + location.hash, | |
| page_search: location.search, |
| import { Controller, Get, Req, Res, UseGuards } from '@nestjs/common'; | |
| import { Request, Response } from 'express'; | |
| import { GoogleOauthGuard } from './google-oauth.guard'; | |
| @Controller('auth/google') | |
| export class GoogleOauthController { | |
| constructor(private jwtAuthService: JwtAuthService) {} | |
| @Get() | |
| @UseGuards(GoogleOauthGuard) |
I am using the built in GSM (UMTS) modem of my Thinkpad X1 extensively because I am often in places with flaky internet connections. I connect through the standard Network Manager on Ubuntu and everything works fine. There was one major annoyance though. Every time I wanted to top up the SIM balance or book a new package, I needed a phone to send and receive USSD codes. So I took some time to figure out how to do it from the shell. I wrote this down as a help for others and a reminder for myself. Without further ado...
First intsall gammu and picocom.
➜ ~ sudo apt-get install -y gammu picocom| _APP_ENV=production | |
| _APP_LOCALE=en | |
| _APP_OPTIONS_ABUSE=enabled | |
| _APP_OPTIONS_FORCE_HTTPS=disabled | |
| _APP_OPENSSL_KEY_V1=your-secret-key | |
| _APP_DOMAIN=localhost | |
| _APP_DOMAIN_TARGET=localhost | |
| _APP_CONSOLE_WHITELIST_ROOT=enabled | |
| _APP_CONSOLE_WHITELIST_EMAILS= | |
| _APP_CONSOLE_WHITELIST_IPS= |
This is just some code I recently used in my development application in order to add token-based authentication for my api-only rails app. The api-client was to be consumed by a mobile application, so I needed an authentication solution that would keep the user logged in indefinetly and the only way to do this was either using refresh tokens or sliding sessions.
I also needed a way to both blacklist and whitelist tokens based on a unique identifier (jti)
Before trying it out DIY, I considered using:
Starting a personal node project could be easy; starting a team node project could be challenging.
I am a developer currently working in SEEK Australia.
In my experience, common mistakes developer make when starting a projects are:
- No Linting
| .git | |
| .gitignore | |
| # Created by https://www.gitignore.io/api/git,ruby,rails,jetbrains+all | |
| # Edit at https://www.gitignore.io/?templates=git,ruby,rails,jetbrains+all | |
| ### Git ### | |
| # Created by git for backups. To disable backups in Git: | |
| # $ git config --global mergetool.keepBackup false | |
| *.orig |
| package demo; | |
| import java.net.URI; | |
| import java.net.http.HttpClient; | |
| import java.net.http.HttpHeaders; | |
| import java.net.http.HttpRequest; | |
| import java.net.http.HttpResponse; | |
| import java.util.concurrent.CompletableFuture; | |
| import java.util.concurrent.ExecutionException; | |
| import java.util.concurrent.ExecutorService; |
