Use these rapid keyboard shortcuts to control the GitHub Atom text editor on macOS.
- ⌘ : Command key
- ⌃ : Control key
- ⌫ : Delete key
- ← : Left arrow key
- → : Right arrow key
- ↑ : Up arrow key
| import { useState, useEffect, useRef, useCallback } from 'react'; | |
| import useThrottledOnScroll from './useThrottledOnScroll'; | |
| const useScrollSpy = ({ items = [], target = window } = {}) => { | |
| const itemsWithNodeRef = useRef([]); | |
| useEffect(() => { | |
| itemsWithNodeRef.current = getItemsClient(items); | |
| }, [items]); | |
| const [activeState, setActiveState] = useState(null); |
| // STEP 0: | |
| // add the segment JS web snippet with your custom segment key to your header on webflow. this is found at your webflow project's dashboard -> custom code -> header. | |
| // STEP 1: | |
| // in the web flow editor, click any element you want to track when clicked, go to its settings, and add custom attributes that follow this pattern: | |
| /* | |
| ~required~ you must add a data-analytics attribute | |
| data-analytics="YOUR_EVENT_NAME_HERE" |
| service: my-service | |
| provider: | |
| name: aws | |
| runtime: nodejs8.10 | |
| stage: ${opt:stage, 'dev'} | |
| environment: | |
| REDIS_HOST: | |
| "Fn::GetAtt": [ElasticCacheCluster, RedisEndpoint.Address] | |
| functions: |
| AWSTemplateFormatVersion: '2010-09-09' | |
| Description: Cognito Stack | |
| Parameters: | |
| AuthName: | |
| Type: String | |
| Description: Unique Auth Name for Cognito Resources | |
| Resources: | |
| # Creates a role that allows Cognito to send SNS messages | |
| SNSRole: |
| var accounts = [ | |
| { name: 'James Brown', msgCount: 123 }, | |
| { name: 'Stevie Wonder', msgCount: 22 }, | |
| { name: 'Sly Stone', msgCount: 16 }, | |
| { name: 'Otis Redding', msgCount: 300 } // Otis has the most messages | |
| ]; | |
| // get sum of msgCount prop across all objects in array | |
| var msgTotal = accounts.reduce(function(prev, cur) { | |
| return prev + cur.msgCount; |
| #!/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 |
| <?php | |
| // PHP memory limit for this site | |
| define( 'WP_MEMORY_LIMIT', '128M' ); | |
| define( 'WP_MAX_MEMORY_LIMIT', '256M' ); // Increase admin-side memory limit. | |
| // Database | |
| define( 'WP_ALLOW_REPAIR', true ); // Allow WordPress to automatically repair your database. | |
| define( 'DO_NOT_UPGRADE_GLOBAL_TABLES', true ); // Don't make database upgrades on global tables (like users) | |
| // Explicitely setting url |
Use these rapid keyboard shortcuts to control the GitHub Atom text editor on macOS.
| // Run this in the F12 javascript console in chrome | |
| // if a redirect happens, the page will pause | |
| // this helps because chrome's network tab's | |
| // "preserve log" seems to technically preserve the log | |
| // but you can't actually LOOK at it... | |
| // also the "replay xhr" feature does not work after reload | |
| // even if you "preserve log". | |
| window.addEventListener("beforeunload", function() { debugger; }, false) |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Open App</title> | |
| <!-- | |
| URL Params: | |
| customSchemeURL: Your custom scheme app |