Skip to content

Instantly share code, notes, and snippets.

View jmdfm's full-sized avatar
💭
😺

John McDowall jmdfm

💭
😺
View GitHub Profile
@samselikoff
samselikoff / future-proof.md
Last active August 2, 2025 18:41
Future-proofing your Ember 1.x code

This post is also on my blog, since Gist doesn't support @ notifications.


Components are taking center stage in Ember 2.0. Here are some things you can do today to make the transition as smooth as possible:

  • Use Ember CLI
  • In general, replace views + controllers with components
  • Only use controllers at the top-level for receiving data from the route, and use Ember.Controller instead of Ember.ArrayController or Ember.ObjectController
  • Fetch data in your route, and set it as normal properties on your top-level controller. Export an Ember.Controller, otherwise a proxy will be generated. You can use Ember.RSVP.hash to simulate setting normal props on your controller.
@staltz
staltz / introrx.md
Last active October 26, 2025 03:06
The introduction to Reactive Programming you've been missing
@natelandau
natelandau / .bash_profile
Last active October 27, 2025 14:01
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
# MODEL
class Case < ActiveRecord::Base
include Eventable
has_many :tasks
concerning :Assignment do
def assign_to(new_owner:, details:)
transaction do
@arobson
arobson / abstractions.md
Last active October 14, 2021 06:46
Rabbit.MQ + Node.js Notes

Abstraction Suggestions

Summary: use good/established messaging patterns like Enterprise Integration Patterns. Don't make up your own. Don't expose transport implementation details to your application.

Broker

As much as possible, I prefer to hide Rabbit's implementation details from my application. In .Net we have a Broker abstraction that can communicate through a lot of different transports (rabbit just happens to be our preferred one). The broker allows us to expose a very simple API which is basically:

  • publish
  • request
  • start/stop subscription
@ndreckshage
ndreckshage / client-javascripts-application.coffee
Created January 22, 2014 23:41
snapsecret v3 (node + ember, not all code included)
(->
Ember = require 'ember'
moment = require 'moment'
# Socket.io
io = window.io
host = location.origin.replace /^http/, 'ws'
socket = io.connect host
# SnapSecret
@mjason
mjason / database.js
Created November 28, 2013 15:40
sequelize for express 配置
var config = require('./config.json')
var environment = process.env.NODE_ENV || 'development'
var databaseConfig = config[environment]
var Sequelize = require('sequelize')
var sequelize = new Sequelize(databaseConfig.database,
databaseConfig.username, databaseConfig.password, {
host: databaseConfig.host,
dialect: databaseConfig.dialect,
import DS from 'ember-data';
import {RSVP} from 'ember';
var Adapter = DS.RESTAdapter.extend({
namespace: 'api/v1',
findAll: function(store, type, sinceToken) {
var url = this.buildURL(type.typeKey);
var cached = localStorage.getItem(url);
@maxim
maxim / rails_load_path_tips.md
Last active January 9, 2025 00:59
How to use rails load paths, app, and lib directories.

In Rails 3

NOTE: This post now lives (and kept up to date) on my blog: http://hakunin.com/rails3-load-paths

If you add a dir directly under app/

Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.

If you add a dir under app/something/

@chrishunt
chrishunt / Gemfile
Last active December 16, 2015 00:28
Fake service for testing
source 'https://rubygems.org'
gem 'foreman'
gem 'sinatra'