A little test interaction for an upcoming web project. Enjoy the bounce!
Normally the installation of MySQL can be achieved with a single command, which executes a script provided by MacMiniVault :
bash <(curl -Ls http://git.io/eUx7rg)
However, at the time of writing the script is not compatible with OS X El Capitan (10.11)
An alternative to the aforementioned installation script is installing MySQL using Homebrew. This gist assumes you already have Homebrew installed, if not first read the article "Homebrew and El Capitan"
Make sure Homebrew has the latest formulae, so run brew update first
A complete list of RxJS 5 operators with easy to understand explanations and runnable examples.
| #!/bin/bash | |
| brew install redis # Install Redis using Homebrew | |
| ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents # Enable Redis autostart | |
| launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist # Start Redis server via launchctl | |
| # homebrew.mxcl.redis.plist contains reference to redis.conf file location: /usr/local/etc/redis.conf | |
| redis-server /usr/local/etc/redis.conf # Start Redis server using configuration file, Ctrl+C to stop | |
| redis-cli ping # Check if the Redis server is running |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script src="https://code.jquery.com/jquery-3.0.0.js"></script> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| </head> | |
| <body> | |
| <script> |
| # View registry settings | |
| Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\*\*\Device` Parameters FlipFlopWheel -EA 0 | |
| # Change registry settings | |
| # Reverse mouse wheel scroll FlipFlopWheel = 1 | |
| # Normal mouse wheel scroll FlipFlopWheel = 0 | |
| Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\*\*\Device` Parameters FlipFlopWheel -EA 0 | ForEach-Object { Set-ItemProperty $_.PSPath FlipFlopWheel 1 } | |
| # Restore default scroll direction | |
| # Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\*\*\Device` Parameters FlipFlopWheel -EA 1 | ForEach-Object { Set-ItemProperty $_.PSPath FlipFlopWheel 0 } |
| // Add a 401 response interceptor | |
| window.axios.interceptors.response.use(function (response) { | |
| return response; | |
| }, function (error) { | |
| if (401 === error.response.status) { | |
| swal({ | |
| title: "Session Expired", | |
| text: "Your session has expired. Would you like to be redirected to the login page?", | |
| type: "warning", | |
| showCancelButton: true, |
| import * as React from 'react' | |
| import { connect } from 'react-redux' | |
| // | |
| // Higher order component (HOC) to provide Anti-Forgery Token | |
| // to a component that needs to send POST request to a back-end | |
| // controller action that has an attribute [ValidateAntiForgeryTokenHeader] | |
| // | |
| export function AntiForgeryTokenized<P extends WithToken>( | |
| Comp: React.ComponentClass<P> | React.StatelessComponent<P> |
| function getTranslate(item: HTMLElement): number | number[] | undefined { | |
| const transArr = []; | |
| if (!window.getComputedStyle) { | |
| return; | |
| } | |
| const style = window.getComputedStyle(item); | |
| const transform = style.transform || style.webkitTransform; | |
| let mat = transform.match(/^matrix3d\((.+)\)$/); | |
| if (mat) { | |
| return parseFloat(mat[1].split(', ')[13]); |