In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of advantages of using submodules:
- You can separate the code into different repositories.
{ | |
"AC": "+247-####", | |
"AD": "+376-###-###", | |
"AE": "+971-5#-###-####", | |
"AE": "+971-#-###-####", | |
"AF": "+93-##-###-####", | |
"AG": "+1(268)###-####", | |
"AI": "+1(264)###-####", | |
"AL": "+355(###)###-###", | |
"AM": "+374-##-###-###", |
public class SomeInterceptor extends HandlerInterceptorAdapter{ | |
@Override | |
public boolean preHandle(final HttpServletRequest request,final HttpServletResponse response,final Object handler) | |
throws Exception | |
{ | |
/*Assume the URI is user/{userId}/post/{postId} and our interceptor is registered for this URI. | |
* This map would then be a map of two elements,with keys 'userId' and 'postId' | |
*/ | |
final Map<String, String> pathVariables = (Map<String, String>) request | |
.getAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE); |
import java.io.BufferedReader; | |
import java.io.BufferedWriter; | |
import java.io.File; | |
import java.io.FileNotFoundException; | |
import java.io.FileReader; | |
import java.io.FileWriter; | |
import java.io.IOException; | |
import java.util.Arrays; | |
import java.util.Scanner; |
<?php | |
/** | |
* User: LuizVAz | |
* Date: 28/02/2021 | |
* Time: 19:46 | |
*/ | |
namespace Provedores\webService; | |
use DOMDocument; |
import java.io.BufferedInputStream; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import org.apache.tika.exception.TikaException; | |
import org.apache.tika.metadata.Metadata; | |
import org.apache.tika.parser.AutoDetectParser; | |
import org.apache.tika.parser.ParseContext; |
Magic words:
psql -U postgres
Some interesting flags (to see all, use -h
or --help
depending on your psql version):
-E
: will describe the underlaying queries of the \
commands (cool for learning!)-l
: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)REM http://www.dbspecialists.com/files/scripts/compare_schemas.sql | |
REM | |
REM compare_schemas.sql | |
REM =================== | |
REM | |
REM This script is provided by Database Specialists, Inc. | |
REM (http://www.dbspecialists.com) for individual use and not for sale. | |
REM Database Specialists, Inc. does not warrant the script in any way | |
REM and will not be responsible for any loss arising out of its use. | |
REM |
/* | |
* Handling Errors using async/await | |
* Has to be used inside an async function | |
*/ | |
try { | |
const response = await axios.get('https://your.site/api/v1/bla/ble/bli'); | |
// Success 🎉 | |
console.log(response); | |
} catch (error) { | |
// Error 😨 |