Skip to content

Instantly share code, notes, and snippets.

View rfarine's full-sized avatar

Rae Farine rfarine

View GitHub Profile
@rfarine
rfarine / log_dirs.sh
Last active December 21, 2020 16:36
Check for log dirs
#!/bin/bash
create_event_logger () {
echo "Directory /var/log/event_logger is being created..."
sudo mkdir /var/log/event_logger
sudo chmod -R 777 /var/log/event_logger
}
create_statsd () {
echo "Directory /var/log/statsd is being created..."
@rfarine
rfarine / .tmux.conf
Last active October 1, 2020 14:56
Tmux
# unicode
set -g default-terminal "screen-256color"
set -g status-bg colour235
set -g status-fg yellow
set -sg escape-time 1
setw -g pane-base-index 1
# force a reload of the config file
unbind r
// state...
const state = {
currentQuestion: 1,
selectedAnswer: '',
score: 0,
questions: {
1: {
title: 'Which element is used for a top-level heading?',
correctAnswer: 'h1',
@rfarine
rfarine / externalName-service.yaml
Last active June 2, 2020 20:57
NGINX Ingress Issues
apiVersion: v1
kind: Service
metadata:
name: foo-service
spec:
type: ExternalName
externalName: foo.staging.bar.com
selector:
app: foo
# Configuration checksum: 1833417130626304953
# setup custom paths that do not require root access
pid /tmp/nginx.pid;
load_module /etc/nginx/modules/ngx_http_modsecurity_module.so;
daemon off;
@rfarine
rfarine / eslint.sh
Last active March 5, 2018 19:56
Adding Eslint
yarn add eslint eslint-config-airbnb eslint-config-prettier eslint-plugin-import eslint-plugin-jest eslint-plugin-jsx-a11y eslint-plugin-react --dev
@rfarine
rfarine / gatsby.sh
Last active March 5, 2018 19:36
Starting from scratch
> yarn global add gatsby-cli
> gatsby new womanlymag-new
@rfarine
rfarine / eslint.sh
Created March 27, 2017 18:14
Only lint files added to repo after a certain date
# adapted from: https://gist.github.com/jhartikainen/36a955f3bfe06557e16e
#!/bin/bash
# Find all js/jsx files staged to commit
staged_files=$(git diff --staged --diff-filter=ACMTUXB --name-only | grep '\.jsx\?$')
files_to_lint=()
# Find all staged js/jsx files created since 2017-01-13
for file in ${staged_files}; do
# if the file has previously been committed, get author date of file:
@rfarine
rfarine / webpack.config.js
Created January 15, 2017 22:41
Only run eslint in webpack config if enabled
// Only enable eslint if ESLINT env var = true
// Will keep things like this until we have 0 errors, then flip switch
if (eslintEnabled) {
config.module.preLoaders.push({
test: /\.jsx?$/,
loader: 'eslint',
exclude: /node_modules/,
});
}
@rfarine
rfarine / package.json
Created January 15, 2017 22:36
Precommit hook
"scripts": {
"precommit": "npm run lint",
"lint": ". ./eslint.sh",
...
},