Skip to content

Instantly share code, notes, and snippets.

View lukegalea's full-sized avatar

Luke Galea lukegalea

View GitHub Profile
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@lukegalea
lukegalea / postgresql.conf
Created November 23, 2016 21:47
Luke's postgres config
# -----------------------------
# PostgreSQL configuration file
# -----------------------------
#
# This file consists of lines of the form:
#
# name = value
#
# (The "=" is optional.) Whitespace may be used. Comments are introduced with
# "#" anywhere on a line. The complete list of parameter names and allowed
@lukegalea
lukegalea / gist:0ad4f5d3d1a9d85c4f7f
Created September 15, 2014 12:57
Need for "soft" get in ember-data
_reloadScoreStats: ->
if @get('isMarkedOrReviewedForm')
@get('membership').then (m) ->
# TODO: Replace with public API when it becomes available
# This will only reload if it's already loaded
stat = m._data.membershipStat
if stat and stat.get('isLoaded')
stat.reload()
# @get('membership.membershipStat') would result in a load if it hadn't already been loaded
# this should go in the location @app or location @unicorn at the top
# if the request included an Origin: header with an origin on the whitelist,
# then it is some kind of CORS request.
# specifically, this example allow CORS requests from
# scheme : http or https
# authority : any authority ending in ".mckinsey.com"
# port : nothing, or :
#if ($http_origin ~* (https?://.*\.mckinsey\.com(:[0-9]+)?)) {
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#
attributes ....., :uses_female_pronouns?
CoachApp.IndexRoute = Ember.Route.extend
model: (params) ->
client_id = localStorage.getItem 'clientId'
localStorage.removeItem('clientId')
if CoachApp.get('token')? and client_id? and !isNaN(client_id, 10)
CoachApp.Client.findById client_id
afterModel: (client) ->
if client
@lukegalea
lukegalea / A-Pen-by-Luke-Galea.markdown
Created September 12, 2013 14:56
A Pen by Luke Galea.
@lukegalea
lukegalea / A-Pen-by-Luke-Galea.markdown
Last active December 22, 2015 20:19
A Pen by Luke Galea.