You will get one of these:
Uncaught (in promise) TypeError: Cannot read property 'toUpperCase' of undefined(โฆ)
ReactCompositeComponent.js:870 Uncaught TypeError: Cannot read property 'displayName' of undefined
if you try to:
| // -------------------------------------------------- | |
| // Flexbox LESS mixins | |
| // The spec: http://www.w3.org/TR/css3-flexbox | |
| // -------------------------------------------------- | |
| // Flexbox display | |
| // flex or inline-flex | |
| .flex-display(@display: flex) { | |
| display: ~"-webkit-@{display}"; | |
| display: ~"-moz-@{display}"; |
| #!/bin/sh | |
| # Borrowed from http://marcparadise.com/blog/2013/09/21/how-to-fix-a-corrupt-history-file/ | |
| # If you ever see a message like this upon starting a new shell | |
| # zsh: corrupt history file /home/marc/.zsh_history | |
| # here is a quick fix | |
| cd ~ | |
| mv .zsh_history .zsh_history_bad | |
| strings .zsh_history_bad > .zsh_history | |
| # And reload history | |
| fc -R .zsh_history |
| var cv = document.getElementById('cv'); | |
| var c = cv.getContext('2d'); | |
| var txtDiv = document.getElementById('txt'); | |
| var fileBtn = document.getElementById("up-button"); | |
| var img = new Image(); | |
| img.src = 'a.jpg'; | |
| img.onload = init; // ๅพ็ๅ ่ฝฝๅฎๅผๅง่ฝฌๆข | |
| fileBtn.onchange = getImg; | |
| // ๆ นๆฎ็ฐๅบฆ็ๆ็ธๅบๅญ็ฌฆ |
A little while ago I started using Typescript with the Angular 1.5 app I'm working on, to help ease the migration path to Angular 2. Here's how I did it. We'll go example by example through migrating real world code living in a large, mostly non-Typescript codebase.
Let's start with a few of the basic angular building blocks, then we'll go through some of the higher level patterns we derived.
| // Declare the color as RGB; SASS will treat this as hex | |
| $green: rgb(27,224,63); | |
| // Declare an alpha | |
| $alpha: .5; | |
| // Declare another color variable as a color with an alpha | |
| $greenAlpha: rgba($green, $alpha); | |
| body { | |
| /* As RGB (which SASS actually ouputs as HEX) */ | |
| background: $green; |
| <template> | |
| <div> | |
| <input type="file" multiple accept="image/jpeg" @change="detectFiles($event.target.files)"> | |
| <div class="progress-bar" :style="{ width: progressUpload + '%'}">{{ progressUpload }}%</div> | |
| </div> | |
| </template> | |
| <script> |
| #!/bin/bash | |
| MONGO_DATABASE="your_db_name" | |
| APP_NAME="your_app_name" | |
| MONGO_HOST="127.0.0.1" | |
| MONGO_PORT="27017" | |
| TIMESTAMP=`date +%F-%H%M` | |
| MONGODUMP_PATH="/usr/bin/mongodump" | |
| BACKUPS_DIR="/home/username/backups/$APP_NAME" |
| ## Problem | |
| When login in, the shell prints: | |
| ``` | |
| manpath: can't set the locale; make sure $LC_* and $LANG are correct | |
| ``` | |
| ## Solution | |
| ``` | |
| sudo locale-gen "en_US.UTF-8" | |
| sudo dpkg-reconfigure locales |
| // -------------------------------------------------- | |
| // Flexbox LESS mixins | |
| // The spec: http://www.w3.org/TR/css3-flexbox | |
| // -------------------------------------------------- | |
| // Flexbox display | |
| // flex or inline-flex | |
| .flex-display(@display: flex) { | |
| display: ~"-webkit-@{display}"; | |
| display: ~"-ms-@{display}box"; // IE10 uses -ms-flexbox |