Skip to content

Instantly share code, notes, and snippets.

View aghecht's full-sized avatar

Alan Hecht aghecht

View GitHub Profile
@aghecht
aghecht / macmini.md
Created July 30, 2025 21:17 — forked from doop/macmini.md
Installing linux on a 2011 Intel mac mini

Installing linux (Debian) on a 2011 Intel mac mini

Apple have long stopped supporting the mid-2011 mac mini I had sitting in the living room, so rather than contribute to the e-waste problem I decided to stick linux on it. The general consensus seems to be that you should keep macOS bootable to make it easier to deal with any firmware issues down the line, so I wanted to set it up to dual boot. The documentation I was able to find on how to do this seemed scattered or out of date.

There are a number of little wrinkles to this process:

  • macOS quite reasonably assumes it'll be the only thing running on the machine; you need to install a boot manager to let you choose between macOS, linux, or whatever else. I went with rEFInd.
  • Something seems a bit off with the default video setup, such that when I first booted into Debian the screen went blank immediately after enabling kernel modesetting.
  • The mac mini wifi uses a Broadcom chipset with non-free drivers which you have to download separately. I s
@aghecht
aghecht / ember-import.js
Last active March 4, 2017 14:12
Ember CLI import shims
'ember': {
'default': Ember
},
'ember-application': {
'default': Ember.Application
},
'ember-array': {
'default': Ember.Array
},
'ember-array/mutable': {
@aghecht
aghecht / ember-data-import.js
Created March 4, 2017 12:46
Ember Data Module Paths
// DS.Model
import Model from 'ember-data/model';
// DS.RESTSerializer
import RESTSerializer from 'ember-data/serializers/rest';
// DS.JSONSerializer
import JSONSerializer from 'ember-data/serializers/json';
// DS.JSONAPISerializer
@aghecht
aghecht / restore
Created October 16, 2016 20:52 — forked from jgillman/restore.sh
pg_restore a local db dump into Docker
# Assumes the database container is named 'db'
DOCKER_DB_NAME="$(docker-compose ps -q db)"
DB_HOSTNAME=db
DB_USER=postgres
LOCAL_DUMP_PATH="path/to/local.dump"
docker-compose up -d db
docker exec -i "${DOCKER_DB_NAME}" pg_restore -C --clean --no-acl --no-owner -U "${DB_USER}" -d "${DB_HOSTNAME}" < "${LOCAL_DUMP_PATH}"
docker-compose stop db
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@aghecht
aghecht / postgres-9.4.sh
Created May 25, 2016 17:53 — forked from carymrobbins/postgres-9.4.sh
Installing PostgreSQL 9.4 on Ubuntu 12.04
sudo apt-get update
sudo apt-get purge postgresql-9.1 postgresql-9.2 postgresql-9.3
# If you don't need postgis, you can probably get away with postgresql-contrib instead.
sudo apt-get install postgresql-client-common postgresql-9.4 postgresql-9.4-postgis-2.1
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
/**
Ember Data: Dependent Relationships
This package extends Ember Data to support creating relationships
where a model's dirty state depends not only on its own attributes
but on the dirty state of models in dependent relationships as well.
```javascript
App.Thing = DS.Model.extend({
name : DS.attr('string'),
#!/bin/sh
### BEGIN INIT INFO
## END INIT INFO
# Path to play install folder
PLAY_HOME=/usr/share/play
PLAY=$PLAY_HOME/play
# Path to the JVM
JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk
/**
Ember Data: Dependent Relationships
This package extends Ember Data to support creating relationships
where a model's dirty state depends not only on its own attributes
but on the dirty state of models in dependent relationships as well.
```javascript
App.Thing = DS.Model.extend({
name : DS.attr('string'),