Skip to content

Instantly share code, notes, and snippets.

db = require "../lib/db"
Q = require "q"
_ = require "lodash"
GROUP = "messages"
class Message
constructor: (obj) ->
# Assign all properties of the object to this.
_.extend(this, obj)
# Remember, this is wrong!
describe 'A simple Angular app testing suite', ->
it "should load a module from an app, and mock the module's dependency.", ->
module 'NameOfApp', ($provide) ->
$provide.value 'bar',
baz: -> true
inject 'foo', (foo) ->
expect(foo).not.toBe(null)
# Remember, this is wrong!
describe 'A simple Angular app testing suite', ->
it "should load a module from an app, and mock the module's dependency.", ->
module 'NameOfApp', ($provide) ->
$provide.value 'bar',
baz: -> true
return null
inject 'foo', (foo) ->
describe('A simple Angular app testing suite', function() {
it("should load a module from an app, and mock the module's dependency.", function() {
module('NameOfApp', function($provide) {
$provide.value('bar', {baz: function(){return true;}});
});
inject('foo', function(foo) {
expect(foo).not.toBe(null);
});
});

Keybase proof

I hereby claim:

  • I am murphyrandle on github.
  • I am murphyrandle (https://keybase.io/murphyrandle) on keybase.
  • I have a public key whose fingerprint is 4883 805F 924D 5DB8 3F28 5D27 55BE 69DC 8596 6961

To claim this, I am signing this object:

@mrmurphy
mrmurphy / index.html
Created September 9, 2014 21:24
[add your bin description] // source http://jsbin.com/befiye/5
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="[add your bin description]" />
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body ng-app="testApp">
<mr-image src="https://api.mnky.es/v1/s/RnHx0Iy6to2Xovoc78DHwQ//2014-08-31%2008.32.07-2.jpg" width="400px"></mr-image>
{-# LANGUAGE OverloadedStrings #-}
import Control.Monad.State
import System.Posix.Unistd
makeStateBetter :: StateT Int IO ()
makeStateBetter = do
curState <- get
put (curState + 1)
pogamMonad :: StateT Int IO ()
data User = User {
id :: String,
email :: String,
hash :: String,
institutionId :: String
} deriving (Show, Generic)
instance ToJSON User
instance FromJSON User
instance ToDatum User
/**
* Changes `class=` to `className=` and 'for=' to `htmlFor=`
* for the sake of JSX!
*/
if (typeof module === 'object' && typeof define !== 'function') {
var define = function (factory) {
module.exports = factory(require, exports, module);
};
}
@mrmurphy
mrmurphy / gist:eafbc734449809e16ea6
Last active August 29, 2015 14:15
Notes to self

Git Fu

Search git history by string

git log -p -S<string here> //git log -p (display diffs as patches) -S 'filter by string' 

Checkout a file from history as a different name:

git show <revId>:<relativePathToOldName> > <newName>