(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| // snippet taken from http://catapulty.tumblr.com/post/8303749793/heroku-and-node-js-how-to-get-the-client-ip-address | |
| function getClientIp(req) { | |
| var ipAddress; | |
| // The request may be forwarded from local web server. | |
| var forwardedIpsStr = req.header('x-forwarded-for'); | |
| if (forwardedIpsStr) { | |
| // 'x-forwarded-for' header may return multiple IP addresses in | |
| // the format: "client IP, proxy 1 IP, proxy 2 IP" so take the | |
| // the first one | |
| var forwardedIps = forwardedIpsStr.split(','); |
| #!/bin/sh | |
| ## backup each mysql db into a different file, rather than one big file | |
| ## as with --all-databases. This will make restores easier. | |
| ## To backup a single database simply add the db name as a parameter (or multiple dbs) | |
| ## Putting the script in /var/backups/mysql seems sensible... on a debian machine that is | |
| ## Create the user and directories | |
| # mkdir -p /var/backups/mysql/databases | |
| # useradd --home-dir /var/backups/mysql --gid backup --no-create-home mysql-backup | |
| ## Remember to make the script executable, and unreadable by others |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| { | |
| // http://eslint.org/docs/rules/ | |
| "ecmaFeatures": { | |
| "binaryLiterals": false, // enable binary literals | |
| "blockBindings": false, // enable let and const (aka block bindings) | |
| "defaultParams": false, // enable default function parameters | |
| "forOf": false, // enable for-of loops | |
| "generators": false, // enable generators | |
| "objectLiteralComputedProperties": false, // enable computed object literal property names |
| var gulp = require('gulp'); | |
| var sourcemaps = require('gulp-sourcemaps'); | |
| var source = require('vinyl-source-stream'); | |
| var buffer = require('vinyl-buffer'); | |
| var browserify = require('browserify'); | |
| var watchify = require('watchify'); | |
| var babel = require('babelify'); | |
| function compile(watch) { | |
| var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel)); |
The easiest way to get the ClamAV package is using Homebrew
$ brew install clamav
Before trying to start the clamd process, you'll need a copy of the ClamAV databases.
Create a freshclam.conf file and configure as so
(To be improved)
http command) — pip install httpiegit-branch-protection.sh as git-branch-protection somewhere in your path (something like ~/bin or ~/.local/bin if you already use it)~/.config/github_token.| //@flow | |
| import { createStore, applyMiddleware } from 'redux'; | |
| import storage from 'redux-persist/lib/storage' | |
| import { composeWithDevTools } from 'redux-devtools-extension'; | |
| import { persistStore, persistReducer } from 'redux-persist'; | |
| import thunk from 'redux-thunk'; | |
| import reducer from 'reducers'; | |
| import { createOffline } from '@redux-offline/redux-offline'; | |
| import offlineConfig from '@redux-offline/redux-offline/lib/defaults/index'; |
REST API response format based on some of the best practices