mirror of
https://gitea.blesmrt.net/mikaela/scripts.git
synced 2024-12-22 02:32:43 +01:00
add .pre-commit-config.yaml & run prettify
This commit is contained in:
parent
32d843fc27
commit
848e951ac6
26
.pre-commit-config.yaml
Normal file
26
.pre-commit-config.yaml
Normal file
@ -0,0 +1,26 @@
|
||||
# Remember to run `pre-commit install` at least once!
|
||||
# Manual test run: `pre-commit run --all-files`
|
||||
# Update? `pre-commit autoupdate`
|
||||
#
|
||||
# See https://pre-commit.com for more information
|
||||
# See https://pre-commit.com/hooks.html for more hooks
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v4.4.0
|
||||
hooks:
|
||||
- id: check-case-conflict
|
||||
- id: check-executables-have-shebangs
|
||||
- id: check-shebang-scripts-are-executable
|
||||
- id: destroyed-symlinks
|
||||
- id: detect-private-key
|
||||
- id: end-of-file-fixer
|
||||
- id: fix-byte-order-marker
|
||||
- repo: https://github.com/pre-commit/mirrors-prettier
|
||||
rev: "v3.0.0-alpha.4"
|
||||
hooks:
|
||||
- id: prettier
|
||||
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
|
||||
rev: "2.7.1"
|
||||
hooks:
|
||||
- id: editorconfig-checker
|
||||
alias: ec
|
16
README.md
16
README.md
@ -11,12 +11,12 @@ through curl/wget.
|
||||
|
||||
### Directories
|
||||
|
||||
* *bash* has just normal bash scripts
|
||||
* *nodejs* **MIGHT** get some nodejs scripts
|
||||
* *WeeChat* is a placeholder and unlikely to get anything.
|
||||
* *ZNC* is another placeholder which is unlikely to get anything.
|
||||
* note that they are *modules* with ZNC, but I don't see why I
|
||||
couldn't put them here.
|
||||
- _bash_ has just normal bash scripts
|
||||
- _nodejs_ **MIGHT** get some nodejs scripts
|
||||
- _WeeChat_ is a placeholder and unlikely to get anything.
|
||||
- _ZNC_ is another placeholder which is unlikely to get anything.
|
||||
- note that they are _modules_ with ZNC, but I don't see why I
|
||||
couldn't put them here.
|
||||
|
||||
*I doubt I am going to write many WeeChat scripts or ZNC modules, so I
|
||||
won't be making subdirectories for different languages.*
|
||||
_I doubt I am going to write many WeeChat scripts or ZNC modules, so I
|
||||
won't be making subdirectories for different languages._
|
||||
|
@ -1,26 +1,24 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
// Require the dns module
|
||||
var dns = require('dns');
|
||||
var dns = require("dns");
|
||||
|
||||
// Function for IPv4
|
||||
var myip4 = function () {
|
||||
// Set DNS servers to OpenDNS IPv4
|
||||
var servers4 = dns.setServers(["208.67.222.222", "208.67.220.220"])
|
||||
// Set DNS servers to OpenDNS IPv4
|
||||
var servers4 = dns.setServers(["208.67.222.222", "208.67.220.220"]);
|
||||
|
||||
// Check where myip.opendns.com resolves to and I think this is a
|
||||
// function that takes arguments err and addresses.
|
||||
dns.resolve4('myip.opendns.com', function (err, addresses) {
|
||||
|
||||
// if err contains a truthy value, an error has occurred
|
||||
if (err) throw err;
|
||||
// Check where myip.opendns.com resolves to and I think this is a
|
||||
// function that takes arguments err and addresses.
|
||||
dns.resolve4("myip.opendns.com", function (err, addresses) {
|
||||
// if err contains a truthy value, an error has occurred
|
||||
if (err) throw err;
|
||||
|
||||
// Print the first thing in array addresses as it has our IPv4
|
||||
// address.
|
||||
console.log(addresses[0]);
|
||||
|
||||
});
|
||||
}
|
||||
// Print the first thing in array addresses as it has our IPv4
|
||||
// address.
|
||||
console.log(addresses[0]);
|
||||
});
|
||||
};
|
||||
|
||||
// IPv6 part is broken because of node bug.
|
||||
// https://github.com/nodejs/node/issues/894
|
||||
|
Loading…
Reference in New Issue
Block a user