Skip to content

Instantly share code, notes, and snippets.

@navels
navels / components.my-component\.js
Last active April 17, 2023 05:03 — forked from pgengler/components.my-component\.js
ember-data unload issue 3.28
import Component from '@glimmer/component';
import { action } from '@ember/object';
import { inject as service } from '@ember/service';
export default class extends Component {
@service router;
@action async unload() {
const a = this.args.a;
const b = a.b;
import Ember from 'ember';
export default Ember.Controller.extend({
db: Ember.computed('refreshDb', function() {
let dump = window.server.schema.db.dump();
return JSON.stringify(dump, null, 2);
}),
import Controller from '@ember/controller';
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
}
import Ember from 'ember';
export default Ember.Controller.extend({
});
@navels
navels / controllers.application.js
Last active February 6, 2023 09:18 — forked from samselikoff/controllers.application.js
Mirage 0.3 - One to Many
import Ember from 'ember';
export default Ember.Controller.extend({
db: Ember.computed('refreshDb', function() {
let dump = window.server.schema.db.dump();
return JSON.stringify(dump, null, 2);
}),
@navels
navels / gist:a267088726108fbf41b7e77a47822b21
Last active January 13, 2023 18:02
ensure script is only run once at a time
# when sourced from another script, causes that script to be run at most once concurrently
if [[ $BASH_VERSION ]]; then
script=$(realpath ${BASH_SOURCE[1]})
else
script=$(realpath ${funcfiletrace[1]%:*})
fi
[[ $FLOCKER ]] || exec env FLOCKER="$script" flock -en "$script" "$script" "$@"
@navels
navels / plex_season_rename_bookmarklet.js
Created November 23, 2017 18:30
Bookmarklet to rename TV show seasons in Plex
javascript:(function(){var inputId='plex-season-title-hack';var input=document.getElementById(inputId);if(!input){var html= '<label for="'+inputId+'">Title</label><div class="input-group"><input type="text" name="title" id="'+inputId+'"></div></div></div>';document.getElementById('lockable-summary').parentElement.insertAdjacentHTML('afterend', html);}})();