Skip to content

Instantly share code, notes, and snippets.

@derrickshowers
derrickshowers / macos-setup.sh
Last active October 24, 2023 00:01
Setup script for macOS.
#!/bin/bash
# Update me!
COMPUTER_NAME="Airfred"
COMPUTER_NETWORK_NAME="Airfred"
# Setup script for macOS.
# Download. Update variables above. Run `chmod 755 ./macos-setup.sh && ./macos-setup.sh`.
# Adapted from: https://gist.github.com/AlexanderSix/c0ac2d87abd205b9a9c9cdb8502c2f4e
# Also adapted from: https://gist.github.com/bradp/bea76b16d3325f5c47d4
import UIKit
import Combine
// Just Publishers
let publisher = Just("Hello, world!")
let subscription = publisher.sink { (theString: String) in
print(theString)
}
// Pass through subjects
import Ember from 'ember';
export default Ember.Component.extend({
init() {
this._super();
this.foo()
},
redirectToSomewhere() {
// window.location = "blah.com";
class ViewController: UIViewController, UICollectionViewDelegate, UICollectionViewDataSource {
@IBOutlet weak var collectionView: UICollectionView!
var text = [
"Some text.",
"Some longer text text text text text text text text text text.",
"Lots text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text."
]
import Ember from 'ember';
export default Ember.Controller.extend({
fooCount: 0
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
rows: [
1,
2,
3,
4,
@derrickshowers
derrickshowers / controllers.application.js
Created August 30, 2016 03:22
Ember.object.create Test
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
testObject: Ember.Object.create({
emberObj: Ember.Object.create({
foo: 'foo',
}),
nonEmberObj: {
@derrickshowers
derrickshowers / controllers.application.js
Last active August 5, 2016 01:25
Auth Route Sibling
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
});
import Ember from 'ember';
export default Ember.Component.extend({
init: function() {
// You need this whenever you override init (talks about it a bit in the docs
this._super(...arguments);
// Get the days left somehow
var deadline = new Date();