Skip to content

Instantly share code, notes, and snippets.

View alexdiliberto's full-sized avatar

Alex DiLiberto alexdiliberto

View GitHub Profile
@alexdiliberto
alexdiliberto / UpdateChocolatey.bat
Created April 18, 2023 20:17 — forked from lowleveldesign/UpdateChocolatey.bat
Scripts to automatically update all Chocolatey packages installed on your system
@echo off
powershell -NoProfile -ExecutionPolicy ByPass -File "%~d0%~p0%~n0.ps1"
@alexdiliberto
alexdiliberto / random-walk.html
Created January 25, 2021 02:23 — forked from hacknightly/random-walk.html
A Random Walk in JavaScript
<html>
<head>
<style>
body {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
display: flex;
justify-content: center;
@alexdiliberto
alexdiliberto / adapters.application.js
Created May 7, 2020 14:45
REST Adapter With Sideloading
import DS from 'ember-data';
export default DS.RESTAdapter.extend({
});

I’m gonna start blanket adding the following rule to all my stylesheets:

:focus:not(:focus-visible) { outline: none }

Gets rid of the annoying outline for mouse users but preserves it for keyboard users, and is ignored by browsers that don’t support :focus-visible.

import { Promise, defer, resolve } from 'rsvp';
export default class AppAdapter {
constructor(options) {
Object.assign(this, options);
}
static create(options) {
return new this(options);
}
// tests/helpers/push-mirage-db-into-store.js
import { registerAsyncHelper } from '@ember/test';
import { run } from '@ember/runloop';
let pushMirageDbIntoStore = function(server, store) {
let tables = Object.keys(server.schema);
tables.forEach(table => {
if (server.schema[table].all) {
let all = server.schema[table].all();
@alexdiliberto
alexdiliberto / components.blank-template.js
Created November 28, 2018 23:15 — forked from sbatson5/components.blank-template.js
Multiple yield blocks in a component template
import Ember from 'ember';
export default Ember.Component.extend({
tagName: ''
});
@alexdiliberto
alexdiliberto / lib-style-group.js
Created October 22, 2018 17:54 — forked from samselikoff/lib-style-group.js
Sample Styled component using EmberMap's Styled mixin.
export default class StyleGroup {
constructor(styles) {
this.styles = styles;
this.name = ''; // must set at runtime
}
}
import Controller from '@ember/controller';
import { get, set } from '@ember/object';
import { action, computed } from '@ember-decorators/object';
export default class ApplicationController extends Controller {
init() {
super.init(...arguments);
const initial = [
{ 'email.address': 'hello@example' },