First, an exercise. Can we represent all of css with plain data? Let's try.
let redText = { color: 'red' };
window.Clipboard = (function(window, document, navigator) { | |
var textArea, | |
copy; | |
function isOS() { | |
return navigator.userAgent.match(/ipad|iphone/i); | |
} | |
function createTextArea(text) { | |
textArea = document.createElement('textArea'); |
# first install pygmentize to the mac OS X or macOS system with the built-in python | |
sudo easy_install Pygments | |
# then add alias to your ~/.bash_profile or ~/.bashrc or ~/.zshrc etc. | |
alias pcat='pygmentize -f terminal256 -O style=native -g' |
import { Directive, ElementRef, forwardRef, Input, Renderer2 } from '@angular/core'; | |
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; | |
import { fromEvent } from 'rxjs/observable/fromEvent'; | |
import { merge } from 'rxjs/observable/merge'; | |
import { timer } from 'rxjs/observable/timer'; | |
import { Subscription } from 'rxjs/Subscription'; | |
export const DEFAULT_VALUE_ACCESSOR : any = { | |
provide: NG_VALUE_ACCESSOR, | |
useExisting: forwardRef(() => NgControlOptionsDirective), |
React Native is great product but lacks for stable, intuitive and easy navigation API during many years. Every year we see new, better API: Native Navigator, ex-Navigator, NavigationExperimental, ex-Navigation, wix native navigation, airbnb native navigation, ReactNavigation...
Once I've started React Native development, in 2015, I created RNRF - simple API for easy navigation. It was clear that better navigation instruments will come later but I didn't want to change my code again and again to switch for better API. Every new major version of RNRF is based on different navigation framework and mostly preserves own API.
Another goal was to represent all navigation flow within one place in clear, human-readable way - similar to iOS Storyboards concept. This way other engineers could understand your app flow faster.
#!/bin/bash | |
# Input: ./extract_kubecfg_cert.sh my-cluster-name username | |
# Output: ./my-cluster-name-ca.crt ./username.crt ./username.key | |
# Exit on error | |
abort(){ | |
echo $1 && exit 1 | |
} | |
# Prerequistes |
BEST WAY TO DOWNLOAD FULL WEBSITE WITH WGET | |
I show two ways, the first way is just one command that doesnt run in the background - the second one runs in the background and in a different "shell" so you can get out of your ssh session and it will continue either way | |
First make a folder to download the websites to and begin your downloading: (note if downloading www.kossboss.com, you will get a folder like this: /websitedl/www.kossboss.com/ ) | |
(STEP1) | |
mkdir /websitedl/ | |
cd /websitedl/ | |
(STEP2) |
node_modules | |
dist/ | |
yarn.lock | |
wwwroot |
import React, { Component } from 'react'; | |
const withDeferRender = Presentational => | |
class DeferRender extends Component { | |
state = { | |
shouldRender: false, | |
}; | |
componentDidMount() { | |
window.requestAnimationFrame(() => { |