In this guide we will cover two main cases:
- Ember specific library
- vendor library
The Ember library will assume that Ember has already ben loaded (higher in the loading order) and thus will assume it has access to the Ember API.
<?php | |
function create_ACF_meta_in_REST() { | |
$postypes_to_exclude = ['acf-field-group','acf-field']; | |
$extra_postypes_to_include = ["page"]; | |
$post_types = array_diff(get_post_types(["_builtin" => false], 'names'),$postypes_to_exclude); | |
array_push($post_types, $extra_postypes_to_include); | |
foreach ($post_types as $post_type) { | |
register_rest_field( $post_type, 'ACF', [ |
llet mockDelay; | |
let mockError; | |
let mockResponse = { | |
get: jest.fn(), | |
ok: true, | |
status: 200, | |
toError: jest.fn(), | |
}; | |
let mockResponseBodies; |
// The class itself is based on the animation helper class in | |
// https://github.com/paulmg/ThreeJS-Webpack-ES6-Boilerplate | |
// but I have changed almost everything except for the class name and the update function. | |
import * as THREE from 'three'; | |
export default class Animation { | |
constructor(scene, animations) { | |
this.scene = scene; | |
this.animations = animations; |
### Taken from https://github.com/Hyperparticle/hyperparticle.github.io/blob/2365749469b1eea3e8c4b18af24a4865fc426fd3/.circleci/config.yml | |
# Javascript Node CircleCI 2.0 configuration file | |
# | |
# Check https://circleci.com/docs/2.0/language-javascript/ for more details | |
# | |
version: 2 | |
jobs: | |
build: | |
docker: |
/** | |
* Configuration #1: Basic Configuration Class | |
* | |
* A basic example utilising a sealed instance of a configuration | |
* class, with user-provided options merged in upon instantation | |
* of the implementation. | |
*/ | |
class Config { | |
constructor() { |
function setUserAgent(window, userAgent) { | |
// Works on Firefox, Chrome, Opera and IE9+ | |
if (navigator.__defineGetter__) { | |
navigator.__defineGetter__('userAgent', function () { | |
return userAgent; | |
}); | |
} else if (Object.defineProperty) { | |
Object.defineProperty(navigator, 'userAgent', { | |
get: function () { | |
return userAgent; |
% brew install gifsicle | |
# modify colors as needed, it will warn you if you specify more than necessary | |
% gifsicle --colors 128 -O3 -o output.gif input.gif |
export default Ember.Component.extend({ | |
fadeDurationInMilliseconds: 300, | |
didInsertElement() { | |
let duration = this.get("fadeDurationInMilliseconds"), | |
element = this.$(); | |
element.fadeIn(duration); | |
}, | |
import Ember from 'ember'; | |
var Promise = Ember.RSVP.Promise; | |
export default function preloadImages(...urls) { | |
let promises = urls.map(url => { | |
return new Promise((resolve, reject) => { | |
let image = new Image(); | |
image.onload = resolve; | |
image.onerror = reject; | |
image.src = url; |