Hoppscotch is the open-source API development ecosystem.
Categories
Adding constraint NetAppToken composing of 3 columns: network, application, token.
Note: you supposed to have chosen a right db: use <database_name>;
ALTER TABLE crypto ADD CONSTRAINT NetAppToken UNIQUE (network, application, token);
SELECT table_schema, table_name, constraint_name FROM information_schema.table_constraints WHERE table_name = 'crypto';
+--------------+------------+-----------------+
| table_schema | table_name | constraint_name |
+--------------+------------+-----------------+
| admin_crypto | crypto | PRIMARY |
| admin_crypto | crypto | NetAppToken |
+--------------+------------+-----------------+
2 rows in set (0.06 sec)
Recently I needed to transform the CURL request into the PHP Curl code, binary data and compressed option having been involved. See the query itself:
curl 'https://terraswap-graph.terra.dev/graphql' -H 'Accept-Encoding: gzip, deflate, br' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Connection: keep-alive' -H 'DNT: 1' -H 'Origin: https://terraswap-graph.terra.dev' --data-binary '{"query":"{\n pairs {\n pairAddress\n latestLiquidityUST\n token0 {\n tokenAddress\n symbol\n }\n token1 {\n tokenAddress\n symbol\n }\n commissionAPR\n volume24h {\n volumeUST\n }\n }\n}\n"}' --compressed
In the post we’ll show how to leverage auth ptoxy (with login/pass) for JAVA application.
In this post I’ll share how I’ve added a LetsEncrypt SSL certificate to a subdomain at VPS with Centos 7 using Vesta CP.
This post is devoted to the steps of how to create subdomain (Centos 7 and Vesta CP) and map a [Laravel] project folder to it.
git remote remove origin
git remote add origin https://<TOKEN>@github.com/<USERNAME>/<REPO>.git
git push --set-upstream origin main
Now you might commit changes to the remote repo without adding PAT into a push command every time.
If you need to create PAT, use the following tut.
Suppose there is a table like below (1 info row only):
Blows Minute (BPM) |
Speed (RPM) | Power, PSI | Flow, PSI | Tool Sys |
---|---|---|---|---|
0-2500 | 0-250 | 1.8 HP | 2.6-13.2 GPM | SDS Max |
How to scrape it using cheerio.js as a parser?
node.exe index.js > scrape.log 2>&1
When executing file index.js we redirect all the console.log() output from console into a file scrape.log .
Sometimes we have the code with html tags that contain nothing but whitespace characters. Often those tags are nested. See a code below:
<div>
<div>
<div></div>
</div>
</div>
What regex might be used to find and remove those tags?
Obvious solution is <div>\s*?<\/div>
.
\s
stands for “whitespace character”. It includes [ \t\n\x0B\f\r]
. That is: \s
matches a space(
) or a tab (\t
) or a line(\n
) break or a vertical tab (\x0B
) sometimes referred as (\v
) or a form feed (\f
) or a carriage return (\r
) .
In general case, we use the following regex:<(?<tag>[a-z]+?)( [^>]+?|)>\s*?<\/(\k<tag>)>
where <tag>
is a named match group: [a-z]+?
When applying it recursively we might use the following code, JAVA:
public static String removeEmptyTags(String html) { boolean compareFound = true; Pattern pattern = Pattern.compile("<(?<tag>[a-z]+?)( [^>]+?|)>\\s*?</(\\k<tag>)>", Pattern.MULTILINE | Pattern.DOTALL); while (compareFound) { compareFound = false; Matcher matcher = pattern.matcher(html); if(matcher.find()) { compareFound = true; html = matcher.replaceAll(""); } } return html; }