If you have to extend an existing object with additional property, always prefer Vue.set()
over Object.assign()
(or spread operator).
Example below explains implications for different implementations.
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
# This file is distributed under New Relic's license terms. | |
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details. | |
# https://dalibornasevic.com/posts/54-how-to-debug-stuck-ruby-processes | |
require 'tempfile' | |
require 'rbconfig' |
### | |
# DISCLAIMER - USE AT YOUR OWN RISK | |
# I'm using it with rails from version 4.2.4 to 4.2.6 | |
# | |
# This file can be pasted in app/models/concerns | |
# | |
# This module needs to be included in the model to enable partial validation. | |
# It is designed to make partial validation transparent for the model. | |
# The controller is ... in control ;) | |
# |
// Promise.all is good for executing many promises at once | |
Promise.all([ | |
promise1, | |
promise2 | |
]); | |
// Promise.resolve is good for wrapping synchronous code | |
Promise.resolve().then(function () { | |
if (somethingIsNotRight()) { | |
throw new Error("I will be rejected asynchronously!"); |
(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.
Below are the steps I took to install ffmpeg, ffmpegthumbnailer, and heroku to use with carrierwave-video and carrierwave-video-thumbnailer gems on my heroku app. I found there was no documentation to do exactly this, so I hope this is helpful for other people (and will save them the countless hours it took me to finally get it to work)
These are the libraries you will end up installing to get all of this to work.
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>GW2API - AngularJS</title> | |
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet"> | |
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.1.4/angular.min.js"></script> | |
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.1.4/angular-resource.min.js"></script> | |
<script src="script.js"></script> |
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
-- | |
provider: twitter | |
uid: '15280529' | |
info: | |
nickname: penguinbusiness | |
name: Charlie Moseley | |
location: Bellevue, WA | |
image: http://a1.twimg.com/profile_images/281933747/kitamura_ava_normal.gif | |
description: Developer, Otaku, Geek. | |
urls: |
#!/bin/sh | |
# 100Mo | |
SIZE=$((100 * 1048576 / 512)) | |
BASEDIR="/usr/local/Cellar/mysql/5.5.15" | |
BIND_ARGS="--socket=/tmp/mysql_ram.sock" | |
# create ramdisk |