Skip to content

Instantly share code, notes, and snippets.

@chriskrycho
chriskrycho / load.js
Last active October 10, 2023 10:47
An auto-tracked AsyncData and load helper (with no proxies!)
import { tracked } from '@glimmer/tracking';
import { helper } from '@ember/component/helper';
import { action } from '@ember/object';
/**
* @template T
* @type {WeakMap<Promise<T>, AsyncData<T, any>>}
*/
const PROMISE_STATE = new WeakMap();
@vasind
vasind / ember-cli-build.js
Last active June 8, 2023 04:33
Ember CLI performance improvements and tips
// Credits to the following posts that helps me to reduce build times drastically
// https://discuss.emberjs.com/t/tips-for-improving-build-time-of-large-apps/15008/12
// https://www.gokatz.me/blog/how-we-cut-down-our-ember-build-time/
//ember-cli-build.js
let EmberApp = require('ember-cli/lib/broccoli/ember-app');
let env = EmberApp.env(),
@tzmartin
tzmartin / embedded-file-viewer.md
Last active July 1, 2024 01:57
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links

@graemeboyd
graemeboyd / gist:cc6f4a325283b8ef03d9
Created November 4, 2015 15:01
Dump Heroku database structure and schema
# Sleep 5 tries to avoid Heroku truncating the output by terminating the connection before everything has transferred.
# Dump structure.sql as heroku_structure.sql
heroku run 'bundle exec rake db:structure:dump && cat db/structure.sql && sleep 5' --app app-name > db/heroku_structure.sql
# Dump schema.rb as heroku_schema.db
heroku run 'bundle exec rake db:schema:dump && cat db/schema.rb && sleep 5' --app app-name > db/heroku_schema.rb