Skip to content

Instantly share code, notes, and snippets.

View TRMW's full-sized avatar
👋
hi, it's me, matt

Matt Wright TRMW

👋
hi, it's me, matt
View GitHub Profile
@TRMW
TRMW / components.my-component.js
Last active January 6, 2017 20:57
boolean draggable attribute bug
import Ember from 'ember';
export default Ember.Component.extend({
attributeBindings: ['foo', 'draggable', 'bar'],
foo: false,
draggable: false,
bar: false
});
@TRMW
TRMW / application.template.hbs
Created January 4, 2017 20:21 — forked from mike183/application.template.hbs
Tagless Component Issue (No JS File)
{{some-component tagName=""}}
@TRMW
TRMW / components.my-component.js
Last active January 4, 2017 19:51
Tagless Component Helper
import Ember from 'ember';
export default Ember.Component.extend({
specialProp: "prop!"
});
@TRMW
TRMW / collectionRerender.coffee
Last active December 15, 2015 12:28
Update Ember.CollectionView after collection is rerendered
contentDidChange: (->
# do updating here
# in this case I needed to ensure that something only happened once, after
# all collection items had rerendered
Ember.run.scheduleOnce 'afterRender', @, @initializeSortable
).observes('content.[]')
@TRMW
TRMW / .bashrc
Last active December 11, 2015 01:59
Slightly modified version of Mark Otto's bash style (http://markdotto.com/2012/10/18/terminal-hotness/) to prevent the wrapping problem discussed here (http://serverfault.com/questions/83382/fix-for-bash-line-wrapping-backspace-display-bugs-on-mac-os-x). I just wrapped the whole in thing in \[ and \].
export PS1='\[\e[0:35m⌘\e[m \e[0:36m\w/\e[m \e[0:33m`git branch 2> /dev/null | grep -e ^* | sed -E s/^\\\\\*\ \(.+\)$/\(\\\\\1\)\ /`\e[m\]'
@TRMW
TRMW / gist:4220710
Created December 6, 2012 00:02
psql

heroku pg:psql - connect to Heroku Postgres psql:

Enter commands

\p - show query buffer

\r - reset query buffer

\g - send query buffer to server AKA DO STUFF

@TRMW
TRMW / gist:1980386
Created March 5, 2012 19:02 — forked from remear/gist:1283121
set Paste and Match Style to default
defaults write .GlobalPreferences NSUserKeyEquivalents -dict-add "Paste and Match Style" -string "@v"
@TRMW
TRMW / IODA API Snippet
Created March 8, 2011 23:06
ioda_api.js
$.ajax({
url: 'http://api.ioda.fm/v1/album',
dataType: 'jsonp',
data: { /* params to IODA api */
format:'jsonp',
app_key:%KEY%,
id:100048
},
success: function(data){
console.log(data);
@TRMW
TRMW / Drupal Help API JSON Response
Created December 1, 2010 19:47
Drupal Help API JSON Response
array
0 =>
object(stdClass)[1]
public 'tid' => string '194' (length=3)
public 'vid' => string '7' (length=1)
public 'name' => string 'Album Only' (length=10)
public 'description' => string 'A track that has been flagged as only for sale with full album purchase. Not available for individual sale. ' (length=108)
public 'weight' => string '0' (length=1)
public 'depth' => int 0
public 'fields' => boolean false