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 the bundle identifier of Numbers app | |
codesign -dv /Applications/Numbers.app/ | |
# explanation of the flags used | |
# | |
# -d, --display Display information about the code at the path(s) given. | |
# -v, --verify Requests verification of code signatures | |
# one line to directly extract the bundle identifier using [rg](https://github.com/BurntSushi/ripgrep) | |
codesign -dv /Applications/Numbers.app/ 2>&1 | rg '^Identifier=' --replace "" |
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
function getElements({ sort = true } = {}) { | |
let elems = Array.from(document.getElementsByTagName("*")).map( | |
(e) => e.localName | |
); | |
let map = new Map(); | |
for (let elem of elems) { | |
if (!map.has(elem)) { | |
map.set(elem, 1); |
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 source = { a: 1, b: 2, c: 3 } | |
const toRemove = "c" | |
const { [toRemove]: toRemove, ...rest } = source | |
// rest will be { a: 1, b: 2 } | |
// source remains { a: 1, b: 2, c: 3} |
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 http = require("http"); | |
const express = require("express"); | |
const app = express(); | |
const HOST = "localhost"; | |
const PORT = 4000; | |
const PROXY_PORT = 8080; | |
setupProxy(); |
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
security find-generic-password -ga "SSID" |
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
# grab 10 lines before & after the pattern | |
# make sure escape sequences are reained so it looks pretty (that's what the -r flag is for in less) | |
grep -B 10 -A 10 "error" file.log | less -r |
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
... | |
app.use(function(req, res, next){ | |
if (app.get('graceful_shutdown') === true) { | |
res.set('Connection', 'close'); | |
} | |
next(); | |
}); | |
app.set('graceful_shutdown_start', function() { |
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
#Allow access to all User-agents: | |
location /robots.txt {return 200 "User-agent: *\nDisallow:\n";} | |
#Disallow access to every User-agent: | |
location /robots.txt {return 200 "User-agent: *\nDisallow: /\n";} |
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
openssl dhparam -out dhparam.pem 4096 |
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 | |
# Replace hostname | |
HOSTNAME=[HOSTNAME HERE] | |
docker run --detach \ | |
--hostname $HOSTNAME \ | |
--publish 443:443 --publish 80:80 --publish 22:22 --publish 9418:9418 \ | |
--name gitlab \ | |
--restart always \ |