export function mergeRefs(refs) { | |
return (value) => { | |
refs.forEach((ref) => { | |
if (typeof ref === "function") { | |
ref(value); | |
} else if (ref != null) { | |
ref.current = value; | |
} | |
}); | |
}; |
This is a compilation of information I found in different postings on the net.
tmux
can be invoked in command mode using tmux -CC
. The simplest way to get a remote tmux session into a window of iterm is to invoke it on the remote host
tl;dr I built a demo illustrating what it might look like to add async rendering to Facebook's commenting interface, while ensuring it appears on the screen simultaneous to the server-rendered story.
A key benefit of async rendering is that large updates don't block the main thread; instead, the work is spread out and performed during idle periods using cooperative scheduling.
But once you make something async, you introduce the possibility that things may appear on the screen at separate times. Especially when you're dealing with multiple UI frameworks, as is often the case at Facebook.
How do we solve this with React?
Based on https://www.gnu.org/software/make/manual/html_node/Quick-Reference.html
Directive | Description |
---|---|
define variable define variable = define variable := define variable ::= define variable += define variable ?= endef |
Define multi-line variables. |
undefine variable |
Undefining variables. |
#!/bin/bash | |
# Give the usual warning. | |
clear; | |
echo "[INFO] Automated Android root script started.\n\n[WARN] Exploit requires sdk module \"NDK\".\nFor more information, visit the installation guide @ https://goo.gl/E2nmLF\n[INFO] Press Ctrl+C to stop the script if you need to install the NDK module. Waiting 10 seconds..."; | |
sleep 10; | |
clear; | |
# Download and extract exploit files. | |
echo "[INFO] Downloading exploit files from GitHub..."; |
export function* main() { | |
const { payload } = yield take(SOME_START_SIGNAL); | |
const watcherInstance = yield fork(updateResource, payload); | |
// cancel task instance on location change | |
yield take(LOCATION_CHANGE); | |
yield cancel(watcherInstance); | |
} | |
function* updateResource(id) { |
# A simplified explanation for moving alias_method_chain to prepend | |
# Sample class | |
class Note | |
def show_id | |
puts self.object_id | |
end | |
end | |
# using alias_method_chain: |
import ReactDOM from 'react-dom/server' | |
import React from 'react' | |
import Typography from '../../src/' | |
import GoogleFont from '../../src/components/GoogleFont' | |
import theme from '../../src/themes/us-web-design-standard' | |
const typography = new Typography(theme) | |
// Hot reload typography in development. |
It "types" the contents of the clipboard.
Why can't you just paste the contents you ask? Sometimes pasting just doesn't work.
- One example is in system password fields on OSX.
- Sometimes you're working in a VM and the clipboard isn't shared.
- Other times you're working via Remote Desktop and again, the clipboard doesn't work in password boxes such as the system login prompts.
- Connected via RDP and clipboard sharing is disabled and so is mounting of local drives. If the system doesn't have internet access there's no easy way to get things like payloads or Powershell scripts onto it... until now.
The Windows version is written in AutoHotKey and easily compiles to an executable. It's a single line script that maps Ctrl-Shift-V to type the clipboard.