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.
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
| Version 2, December 2004 | |
| Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE> | |
| Everyone is permitted to copy and distribute verbatim or modified | |
| copies of this license document, and changing it is allowed as long | |
| as the name is changed. | |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
| (function() { | |
| var CSSCriticalPath = function(w, d, opts) { | |
| var opt = opts || {}; | |
| var css = {}; | |
| var pushCSS = function(r) { | |
| if(!!css[r.selectorText] === false) css[r.selectorText] = {}; | |
| var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/); | |
| for(var i = 0; i < styles.length; i++) { | |
| if(!!styles[i] === false) continue; | |
| var pair = styles[i].split(": "); |
| return View.extend({ | |
| initialize: function () { | |
| this.el.attr("draggable", "true") | |
| this.el.bind("dragstart", _.bind(this._dragStartEvent, this)) | |
| }, | |
| _dragStartEvent: function (e) { | |
| var data | |
| if (e.originalEvent) e = e.originalEvent | |
| e.dataTransfer.effectAllowed = "copy" // default to copy |
| // Array literal (= []) is faster than Array constructor (new Array()) | |
| // http://jsperf.com/new-array-vs-literal/15 | |
| var array = []; | |
| // Object literal (={}) is faster than Object constructor (new Object()) | |
| // http://jsperf.com/new-array-vs-literal/26 | |
| var obj = {}; | |
| // property === undefined is faster than hasOwnProperty(property) | |
| // http://jsperf.com/hasownproperty-vs-in-vs-undefined/17 |
| <?php | |
| namespace app\components\facades; | |
| /** | |
| * Example how to use the facade class | |
| * uses yii\web\Connection | |
| */ | |
| class Db extends Facade | |
| { |
| <html> | |
| <head> | |
| <title>Hello, from Go</title> | |
| </head> | |
| <body> | |
| <h1>Hello</h1> | |
| <p> | |
| This is Go code running, {{.}} | |
| </p> | |
| </body> |
| <?php | |
| /** | |
| * Example of usage and results | |
| * $a = [ 7, -10, 13, 8, 4, -7.2, -12, -3.7, 3.5, -9.6, 6.5, -1.7, -6.2, 7 ]; | |
| * print_r(nearest(-3.1, $a)); // idx = 7, delta = 0.6, val = -3.7 | |
| * print_r(nearest(7, $a)); // idx = 0, delta = 0, val = 7 | |
| * print_r(nearest(0, $a)); // idx = 11, delta = 1.7, val = -1.7 | |
| */ | |
| function nearest($needle, $haystack) { | |
| // do some basic check of inputs |
Magic words:
psql -U postgresSome interesting flags (to see all, use -h or --help depending on your psql version):
-E: will describe the underlaying queries of the \ commands (cool for learning!)-l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)