This file contains 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
# list files by name | |
# | |
# find $PATH -name '$FILE_NAME' -print | rev | cut -d/ -f1 | rev" | |
# | |
# eg all javascript files in "src" | |
# | |
find ./src -name '*.js' -print | rev | cut -d/ -f1 | rev |
This file contains 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
FROM zackferrofields/app:base as builder | |
COPY . . | |
RUN yarn \ | |
&& yarn build | |
FROM nginx | |
COPY nginx/conf.d/ /etc/nginx/conf.d/ | |
COPY nginx/default.d/dashboard.conf /etc/nginx/default.d/ | |
COPY nginx/data/www /var/www/zackferrofields |
This file contains 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
let return = (a: 'a) : option('a) => Some(a); | |
let bind = (m: option('a), f: 'a => option('b)) : option('b) => | |
switch (m) { | |
| None => None | |
| Some(a) => f(a) | |
}; | |
let (>>=) = bind; |
This file contains 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 | |
# Chrome DevTools debug, | |
# a reverse-proxy NodeJS Docker container | |
# | |
# Example docker-compose file | |
# | |
# version: "3" | |
# services: | |
# proxy: |
This file contains 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 | |
# stop running containers | |
docker ps -q | xargs docker stop | |
# force remove all containers | |
docker ps -a -q | xargs docker rm -f | |
# force remove all untagged images | |
docker images -q --filter dangling=true | xargs docker rmi -f |
This file contains 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
import { createElement } from 'react'; | |
import { compose } from 'ramda'; | |
import { lifecycle, withProps } from 'recompose'; | |
const enhance = compose( | |
lifecycle({ componentDidMount() { | |
this.refs.node.scrollIntoView({block: 'end', behavior: 'smooth'}); | |
} }), | |
withProps({ ref: 'node' }), | |
); |
This file contains 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
module.exports = { | |
cmd: 'nave use 7 bash -c "sh lambci_test.sh"' | |
} |
This file contains 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
''' | |
Follow these steps to configure the webhook in Slack: | |
1. Navigate to https://<your-team-domain>.slack.com/services/new | |
2. Search for and select "Incoming WebHooks". | |
3. Choose the default channel where messages will be sent and click "Add Incoming WebHooks Integration". | |
4. Copy the webhook URL from the setup instructions and use it in the next section. |
This file contains 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 fs = require('fs'); | |
const path = require('path'); | |
const PORT = 8000; | |
const filePath = path.join(__dirname, 'index.html'); | |
http.createServer((req, res) => { | |
res.writeHead(200, {'Content-Type': 'text/html'}); | |
fs.createReadStream(filePath) | |
.on('data', data => res.write(data)) |
This file contains 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 fs = require('fs'); | |
const path = require('path'); | |
const url = require('url'); | |
const PORT = 8000; | |
http.createServer((req, res) => { | |
const pathname = url.parse(req.url).pathname; | |
const isStaticFile = !!path.extname(pathname); | |
const filePath = path.join(__dirname, isStaticFile ? path.join('static', pathname) : 'views/index.html'); |
NewerOlder