Skip to content

Instantly share code, notes, and snippets.

Mike Pastore mwpastore

Block or report user

Report or block mwpastore

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
mwpastore / controllers.application\.js
Created Mar 9, 2020
(action (mut foo)) vs (fn (mut foo))
View controllers.application\.js
import Controller from '@ember/controller';
import { tracked } from '@glimmer/tracking';
export default class ApplicationController extends Controller {
propDidUpdate = false;
mwpastore / shares.conf
Last active Jan 9, 2020
Example of Samba ACL changes from 4.10 to 4.11
View shares.conf
browsable = yes
read only = no
guest ok = no
valid users = @users
path = /tank/active
block size = 4096
write cache size = 131072
mwpastore /
Last active Dec 20, 2019
VCL snippets
mkfs.ext4 -b 4k -C 128k -E num_backup_sb=0,packed_meta_blocks=1,root_owner=111:118 -O bigalloc,extent,flex_bg,^has_journal,mmp,sparse_super2 -L varnish-cache -N 64 -v /dev/sdc
mwpastore /
Last active Jun 4, 2018
Automated VLAN flop for AT&T RG workaround
# Execute a VLAN "flop" to allow the AT&T Residential Gateway (RG) to perform
# 802.1x authentication via the Optical Network Terminal (ONT) before falling
# back to the subscriber's "own" router/gateway hardware. The RG is toggled off
# and on as needed via a remote-controlled power outlet (see below).
# For more information about this procedure, please see brianlan's original
mwpastore / -computed-promise.js
Last active Sep 28, 2017
Promise-aware compute macros
View -computed-promise.js
import computed from 'ember-macro-helpers/computed';
import PromiseProxyMixin from '@ember/object/promise-proxy-mixin';
import { typeOf } from '@ember/utils';
import { all } from 'rsvp';
export default function(Proxy) {
const PromiseProxy = Proxy.extend(PromiseProxyMixin);
import Ember from 'ember';
export default Ember.Component.extend({
greeting: 'Hello',
actions: {
showAlert(message) {
const greeting = this.get('greeting');
alert(`${greeting}, ${message}!`);
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
queryParams: ['endDate'],
startDate: '09/01/2017',
endDate: '09/30/2017'
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
store: Ember.inject.service(),
count: 0,
foo: null,
init() {
mwpastore / cached-computed.js
Last active Aug 6, 2017
cached computed macro
View cached-computed.js
import { run } from '@ember/runloop';
import { computed } from '@ember/object';
const { stringify } = JSON;
export default function(...props) {
const { getState, update } = props.pop();
const strippedProps = => {
You can’t perform that action at this time.