This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . "..." -not -path "./node_modules/*" -not -path "./.git/*" -not -path "./public/*" | |
grep -rnw . -e "..." --exclude-dir={node_modules,.git,public} | |
mysql.server start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo mkfs.ext4 -m 0 -F -E lazy_itable_init=0,lazy_journal_init=0,discard /dev/sdb | |
sudo mkdir -p /mnt/disks/sdb | |
sudo mount -o discard,defaults /dev/sdb /mnt/disks/sdb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sum -> sum "+" product {% d => d[0] + d[2] %} | |
| sum "-" product {% d => d[0] - d[2] %} | |
| product {% d => d[0] %} | |
product -> product "*" factor {% d => d[0] * d[2] %} | |
| product "/" factor {% d => d[0] / d[2] %} | |
| factor {% d => d[0] %} | |
factor -> "(" sum ")" {% d => d[1] %} | |
| float {% d => d[0] %} | |
float -> num "." num {% d => parseFloat(d[0] + d[1] + d[2]) %} | |
| num {% d => parseInt(d[0]) %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT t.term_id, | |
t.name, | |
t.slug, | |
count(post.ID) AS total | |
FROM wp_terms AS t | |
INNER JOIN wp_term_taxonomy AS tt ON (t.term_id = tt.term_id) | |
INNER JOIN wp_term_relationships AS tr ON (tr.term_taxonomy_id = tt.term_taxonomy_id) | |
LEFT JOIN wp_posts post ON (post.ID = tr.object_id) | |
WHERE tt.taxonomy IN ('course_category') | |
GROUP BY t.term_id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const OneSignal = require('onesignal-node'); | |
const client = new OneSignal.Client({ | |
app: { | |
appAuthKey: '*', | |
appId: '*', | |
}, | |
}); | |
const notification = new OneSignal.Notification({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
. $HOME/.nvm/nvm.sh | |
yarn build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT t.term_id, t.name, t.slug | |
FROM wp_terms AS t | |
INNER JOIN wp_term_taxonomy AS tt ON (t.term_id = tt.term_id) | |
INNER JOIN wp_term_relationships AS tr ON (tr.term_taxonomy_id = tt.term_taxonomy_id) | |
WHERE tt.taxonomy IN ('course_category') AND tr.count > 0 | |
ORDER BY t.name ASC |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.3.1/swagger-codegen-cli-2.3.1.jar -O swagger-codegen-cli.jar | |
apt install default-jre | |
alias swagger="java -jar swagger-codegen-cli.jar" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const https = require('https'); | |
https.get('https://ifconfig.co/json', resp => { | |
let data = ''; | |
resp.on('data', chunk => { | |
data += chunk; | |
}); | |
resp.on('end', () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const string = require("string"); | |
const s = (text, func, ...params) => string(text)[func](...params).s; |