Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am morganick on github.
  • I am morganick (https://keybase.io/morganick) on keybase.
  • I have a public key ASAr3Pp6ESLpZCLSVOcmutDDn2N3u-V71mRvnrKdCwHiCAo

To claim this, I am signing this object:

@morganick
morganick / side-effects-are-evil
Last active February 14, 2018 01:55
@searls needed some convincing
Reasons side effects are not bad but evil.
- Having a side effect means you are always working, testing, and thinking about more than one unit
- They often break one or more of the following principles SRP, Law of Demeter, Encapsulation, etc
- Creates known & unknown implicit dependencies
- Side effects can also have side effects (ahem... ActiveRecord callbacks)
- Causes more code churn. Changes in one area cascade to other areas.
- Makes test setup harder. Your test setup contains objects that are seemingly unrelated to the code under test.
Alternate titles:
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@morganick
morganick / controllers.application.js
Last active August 29, 2015 14:27
yuno call awesome
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
actions: {
awesome: function() {
alert("awesome");
}
}

Keybase proof

I hereby claim:

  • I am morganick on github.
  • I am morganick (https://keybase.io/morganick) on keybase.
  • I have a public key whose fingerprint is A983 FC67 3D36 605C 84F5 8138 FB04 5096 1AD6 04F5

To claim this, I am signing this object:

cd /usr/local/Cellar/imagemagick/6.8.0-10/lib
ln -s libMagick++-Q16.7.dylib libMagick++.dylib
ln -s libMagickCore-Q16.7.dylib libMagickCore.dylib
ln -s libMagickWand-Q16.7.dylib libMagickWand.dylib
you may also need to brew install libtool; brew link libtool
@morganick
morganick / gist:1135516
Created August 9, 2011 23:47
Bulk Update rows.. there has to be a faster way
UPDATE contacts SET primary_email_id = (
SELECT id FROM contact_emails
WHERE contact_id = contacts.id AND is_primary = 1
)
@morganick
morganick / gemset_list_all
Created February 21, 2011 18:56
This is the error I get because I am not using the latest ree
~/Sites/dev/projectname/crm [facelift] $ rvm gemset list_all
ERROR: Gemset 'aos-2.3.10' does not exist, rvm gemset create 'aos-2.3.10' first.
ERROR: Unknown ruby interpreter string component: 'WARN:'
gemsets for (found in /Users/username/.rvm/gems/)
ERROR: $rvm_ruby_string is not set!
ERROR: Gemset 'projectname' does not exist, rvm gemset create 'projectname' first.
WARN: ree ree-1.8.7-2011.02 is not installed.
To install do: 'rvm install ree-1.8.7-2011.02'
@morganick
morganick / alias_create
Created February 21, 2011 18:12
Looks like we have a miss spelling or something; this is after a fresh install.
~ $ rvm alias create blah ree@mygemset
/Users/username/.rvm/scripts/alias: line 197: aliase_create: command not found