Skip to content

Instantly share code, notes, and snippets.

View zeppelin's full-sized avatar
🐹

Gabor Babicz zeppelin

🐹
View GitHub Profile
@zeppelin
zeppelin / mac-ubuntu-setup.sh
Last active May 1, 2026 19:47
ubuntu-mbp-2015.sh
#!/usr/bin/env bash
#
# mac-ubuntu-setup.sh — Post-install Mac hardware support for Ubuntu
#
# Tested on 2015 MacBook Pro (MacBookPro12,1 / 11,4 / 11,5) with Ubuntu 24.04 LTS.
# Likely works on other Intel MacBook Pro models 2011–2017.
#
# What it does:
# 1. Updates apt package lists and upgrades installed packages
# 2. Installs Broadcom Wi-Fi driver (bcmwl-kernel-source)
@zeppelin
zeppelin / conventional-test-selectors.ts
Created April 17, 2019 19:48
Conventional test selectors
test('createTestSelector', function(assert) {
// Base namespace could be, for example, the component's name
let base = createTestSelector('namespace');
// Element that appears only once on the screen at a time
assert.equal(base('single'), '[data-test-namespace="single"]');
// List of elements, targeting all items
assert.equal(base('multiple', null), '[data-test-namespace^="multiple:"]');
import EmberObject from '@ember/object';
class SubclassWithEmberInit extends EmberObject {
someProp = 'value';
init() {
super.init(...arguments);
console.log(this.someProp); // undefined
// `this.someProp` will be available after initialization,
// just not from the `init` method...
@zeppelin
zeppelin / controllers.application.js
Created March 20, 2018 10:35
cp-validations-default-value
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
export default Ember.Controller.extend({
m: ['a', 'b', 'c', 'd', 'e', 'f']
});
@zeppelin
zeppelin / controllers.application.js
Created August 22, 2017 12:59
Pickle Rick preventDefault demo
import Ember from 'ember';
export default Ember.Controller.extend({
actions: {
handleClick(name, e) {
alert(name);
e.preventDefault();
}
}
});
.defaultButton {
@extend .btn;
@extend .btn-default;
}
new MutationObserver(function() {
var slotA = {
count: 0,
color: null,
element: null
};
var slotB = {
count: 0,
color: null,
@zeppelin
zeppelin / 1-readme.md
Last active August 29, 2015 14:17
Ember ES2015 Modules

Ember ES2015 Modules

The purpose of this document is to demonstrate how methods and classes could be imported inside an Ember CLI project, instead of accessing them on the Ember namespace.

For example, instead of doing this:

import Ember from 'ember';

export default Ember.Component.extend({
@zeppelin
zeppelin / index-route.js
Created December 16, 2014 10:29
Replace root URL with the localized root
import Ember from 'ember';
var Route = Ember.Route;
export default Route.extend({
redirect() {
this.replaceWith('root'); // Replace URL: / -> /en-US
}
});