Skip to content

Instantly share code, notes, and snippets.

View ezy's full-sized avatar

Ezy ezy

  • Earth
View GitHub Profile
@ezy
ezy / test.md
Last active September 14, 2023 00:09
Debugging Qunit tests

Run the tests using ember test -f 'acceptance' --serve. This will persist the browser, and will run the tests on source code change. You will be presented with the testem interface.

The way I step through the tests is in the test source code, guess where you think the tests are failing, and insert a pauseTest();. When the tests run in the browser, tick the development tickbox, and the testem interface will disppear, but you will notice the test run. It should stop at the point where you put the pauseTest in. Open up the devtools and use the console like an interactive debugger, except if you want to step forward, just copy and paste the code from the test into the console.

@ezy
ezy / console-timer.js
Created February 27, 2017 02:38
Records performance of a function execution in JS
console.time('someFunction');
someFunction(); // run whatever needs to be timed in between the statements
console.timeEnd('someFunction');
@ezy
ezy / components.child-component.js
Created March 6, 2017 20:10
Input send action states
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
setAutoRefresh() {
console.log(this.get('autoRefresh'));
if (this.get('autoRefresh') === true) {
Ember.run.later(function() {
console.log('refreshed');
this.sendAction('setAutoRefresh');
@ezy
ezy / Postgres.txt
Last active August 11, 2017 01:49
Useful postgres commands
Login to postgresql:
psql -d mydb -U myuser -W
psql -h myhost -d mydb -U myuser -W
psql -U myuser -h myhost "dbname=mydb sslmode=require" # ssl connection
Default Admin Login:
sudo -u postgres psql -U postgres
sudo -u postgres psql
List databases on postgresql server:
@ezy
ezy / noscript.html
Created May 17, 2017 04:24
No Javascript enabled
<noscript>
<div class="alert alert-danger">
You must have Javascript enabled to use this site. Please enable Javascript and reload the page.
</div>
</noscript>
@ezy
ezy / ember-owner.js
Last active May 21, 2017 23:16 — forked from eliotsykes/current-route-query-params-ember-component.js
How to lookup or resolve other class instances, or register new factories into the owner.
/**
* For Ember < 2.4
*/
this.get('container').lookup('router:main').router.state;
/**
* For Ember > 2.4
*/
import Ember from 'ember';
const { getOwner } = Ember;
@ezy
ezy / Angular-cli.md
Created May 22, 2017 07:47 — forked from cortesben/Angular-cli.md
Bash commands and Angular CLI commands

#Angular-cli oh shit!

https://cli.angular.io/reference.pdf

Commands Description
ng help returns all commands with flags they can take as a param
ng new [project-name] create a brand new angular project with live server BANG!
ng init grabs name from folder that already exist
@ezy
ezy / keybase.md
Created November 28, 2017 04:45
Keybase

Keybase proof

I hereby claim:

  • I am ezy on github.
  • I am ezy (https://keybase.io/ezy) on keybase.
  • I have a public key ASC0oNSQPo-9fqUaq6Rd92DxoG2afbTdPoEwm0D8ULUeDgo

To claim this, I am signing this object:

@ezy
ezy / testem.js
Last active November 29, 2017 01:57
Chrome headless testem file for ember qunit
/* eslint-env node */
module.exports = {
framework: 'qunit',
test_page: 'tests/index.html?hidepassed',
disable_watching: true,
launch_in_ci: ['Chrome'],
launch_in_dev: ['Chrome'],
browser_args: {
'Chrome': ['--headless', '--disable-gpu', '--remote-debugging-port=9222'],
},
@ezy
ezy / ember-test.js
Created February 2, 2018 00:40
Ember testing cheatsheet
// Visit URLS
andThen(() => {
visit('/url');
});
// Fill in inputs
fillIn('input#id', 'string');
// Click things
click('button#submit-button');