(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.
(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.
| // | |
| // Warnings.xcconfig | |
| // | |
| // The list of warnings we (don’t) use, and the reasons why. | |
| // | |
| // :MARK: Warnings in use: | |
| // :MARK: -everything | |
| // We want the best possible diagnostics, so we simply enable everything that exists, and then opt–out of what doesn’t make sense for us. | |
| // | |
| // :MARK: - Warnings not to be promoted: |
| /* ~/Library/KeyBindings/DefaultKeyBinding.Dict | |
| This file remaps the key bindings of a single user on Mac OS X 10.5 to more | |
| closely match default behavior on Windows systems. This makes the Command key | |
| behave like Windows Control key. To use Control instead of Command, either swap | |
| Control and Command in Apple->System Preferences->Keyboard->Modifier Keys... | |
| or replace @ with ^ in this file. | |
| Here is a rough cheatsheet for syntax. | |
| Key Modifiers |
| /// Performs `block` immediately and ignores subsequent calls during the same runloop. | |
| #define pspdf_ensureCalledOnlyOncePerRunloop(block) do { \ | |
| static const char __onceKey; _pspdf_ensureCalledOnlyOncePerRunloop(self, &__onceKey, block); } while(0) | |
| extern void _pspdf_ensureCalledOnlyOncePerRunloop(id self, const void *key, dispatch_block_t block); | |
| void _pspdf_ensureCalledOnlyOncePerRunloop(id self, const void *key, dispatch_block_t block) { | |
| NSCParameterAssert(block); | |
| NSCParameterAssert(self); | |
| PSPDFAssertOnMainThread(); // run loop needs the main thread. |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent| /*<?php | |
| //*/public class PhpJava { public static void main(String[] args) { System.out.printf("/*%s", | |
| //\u000A\u002F\u002A | |
| class PhpJava { | |
| static function main() { | |
| echo(//\u000A\u002A\u002F | |
| "Hello World!"); | |
| }} | |
| //\u000A\u002F\u002A | |
| PhpJava::main(); |
| javascript: | |
| document.querySelectorAll('.load-diff-button').forEach(node => node.click()) |
| #!/bin/bash | |
| # Script that updates the iTerm Badge with the hostname of the server that you are | |
| # connecting to with ssh. | |
| # | |
| # Instructions: | |
| # - Put this script in ~/bin/ssh (this will override the default ssh binary) | |
| # - Run 'chmod +x ~/bin/ssh' to give execution permission to the script | |
| # - Open iTerm\Preferences\Profiles, select your profile and put '\(user.current_ssh_host)' in the Badge text box | |
| # - Enjoy! |