Search By Label
customer_id
and name
product_id
and name
SELECT customers.customer_id, customers.name, products.product_id, products.name FROM customers CROSS JOIN products;
.replace()
to match everything from the start of your string up until the first dot .
, and replace that with an empty string.var str = "P001.M003.PO888393";
var res = str.replace(/^[^\.]*\./, '');
console.log(res);
#=> M003.PO888393
arr = new Array(3).fill(0)
docker push NAME[:TAG]
docker tag [OPTIONS] IMAGE[:TAG] [REGISTRYHOST/][USERNAME/]NAME[:TAG]
docker tag 518a41981a6a myRegistry.com/myImage
GET
request expresses the user's intent to not have any side effects. Naturally, there will always be side effects on the server like log entries for example, but the important distinction here is whether the user had asked for a side effect or not.GET
surfaces if you respond with the recommended 201 Created
response for a request where the resource is being created on the server. The next request would result in a different response with status 200 OK
and thus it cannot be cached as is usually the case with GET
requests.The PUT method requests that the enclosed entity be stored under the supplied Request-URI. If the Request-URI refers to an already existing resource, the enclosed entity SHOULD be considered as a modified version of the one residing on the origin server. If the Request-URI does not point to an existing resource, and that URI is capable of being defined as a new resource by the requesting user agent, the origin server can create the resource with that URI.
If a new resource is created, the origin server MUST inform the user agent via the 201 (Created) response. If an existing resource is modified, either the 200 (OK) or 204 (No Content) response codes SHOULD be sent to indicate successful completion of the request. If the resource could not be created or modified with the Request-URI, an appropriate error response SHOULD be given that reflects the nature of the problem.
409 Conflict
in case an update would result in a different state.then
or catch
.// Add a request interceptor axios.interceptors.request.use(function (config) { // Do something before request is sent return config; }, function (error) { // Do something with request error return Promise.reject(error); }); // Add a response interceptor axios.interceptors.response.use(function (response) { // Any status code that lie within the range of 2xx cause this function to trigger // Do something with response data return response; }, function (error) { // Any status codes that falls outside the range of 2xx cause this function to trigger // Do something with response error return Promise.reject(error); });
usePathname
is a Client Component hook that lets you read the current URL's pathname.'use client' import { usePathname } from 'next/navigation' export default function ExampleClientComponent() { const pathname = usePathname() return <p>Current pathname: {pathname}</p> }
usePathname
intentionally requires using a Client Component. It's important to note Client Components are not a de-optimization. They are an integral part of the Server Components architecture.<Link key={link.name} href={link.href} className={clsx( 'flex h-[48px] grow items-center justify-center gap-2 rounded-md bg-gray-50 p-3 text-sm font-medium hover:bg-sky-100 hover:text-blue-600 md:flex-none md:justify-start md:p-2 md:px-3', { 'bg-sky-100 text-blue-600': pathname === link.href, }, )} > <LinkIcon className="w-6" /> <p className="hidden md:block">{link.name}</p> </Link>
debugger
statement directly in your Node code to create breakpoints. When the Node runtime hits the debugger
statement, it will pause execution if a debugger is attached.function exampleFunction() { const value = 42; debugger; // Execution will pause here if a debugger is attached console.log(value); } exampleFunction();
--inspect
or --inspect-brk
flag when running your app.node --inspect --5120 lib/app.js
Debugger listening on ws://127.0.0.1:9229/65b96f6d-6202-49db-bbe8-63b706a580a2
x = 10 y = x print(id(x)) # Output: 140737469306640 print(id(y)) # Output: 140737469306640
x
and y
refer to the same integer object with the memory address 140737469306640
. The reference count of this object is 2.del x print(id(y)) # Output: 140737469306640
x
, the reference count of the integer object becomes 1. Since y
is still pointing to it, the object is not garbage collected.