Skip to content

Instantly share code, notes, and snippets.

@robertwalsh0
robertwalsh0 / help.coffee
Created September 27, 2014 21:45
Help w/Protractor.coffee
#Trying to figure out how to get protractor working
# My first test is simple. Visit the page and see if this thing is on the page
# That test works fine.
# The second test is clicking a button and waiting to see if errors appear
# No matter what I try that I find on the net I can't get it to work. Help?
beforeEach ->
# the following command allows us to
# use protractor with our non-angular application
@robertwalsh0
robertwalsh0 / angular-with-foundation.js
Created August 21, 2014 16:35
Incorporate Foundation into Angular App
.run(function($rootScope) {
$rootScope.$on('$viewContentLoaded', function () {
$(document).foundation();
});
});
var allBlogs = function(cb){
Blog.find({}, function(err, docs){
if(err){
cb(err, null);
}
else{
cb(null, docs);
}
});
};
@robertwalsh0
robertwalsh0 / github.css
Created January 28, 2014 23:31
Github css
body {
font-family: Helvetica, arial, sans-serif;
font-size: 14px;
line-height: 1.6;
padding-top: 10px;
padding-bottom: 10px;
background-color: white;
padding: 30px; }
body > *:first-child {
@robertwalsh0
robertwalsh0 / module.js
Created May 10, 2013 03:43
module pattern
var myModule = (function($, undefined){
var myVar1 = '',
myVar2 = '';
var someFunction = function(){
return myVar1 + " " + myVar2;
};
return {
getMyVar1: function() { return myVar1; }, //myVar1 public getter
@robertwalsh0
robertwalsh0 / module_pattern.js
Last active December 16, 2015 07:19
Module pattern
var MODULE = (function () {
var my = {},
privateVariable = 1;
function privateMethod() {
// ...
}
my.moduleProperty = 1;
my.moduleMethod = function () {
@robertwalsh0
robertwalsh0 / gist:5321815
Created April 5, 2013 19:10
Why this.getFooterView?
@ConversationClone.module "FooterApp.Show", (Show, App, Backbone, Marionette, $, _) ->
Show.Controller =
showFooter: ->
footerView = @getFooterView
getFooterView: ->
new Show.Footer
@robertwalsh0
robertwalsh0 / duplicates_in_array.rb
Created February 18, 2013 17:35
Finding duplicates in an array ruby
a = ["A", "B", "C", "B", "A"]
a.detect{ |e| a.count(e) > 1 }
@robertwalsh0
robertwalsh0 / fat arrow.coffee
Created February 17, 2013 19:44
Fat arrow?
firstname = "fatArrow other person"
bill =
firstname: 'skinnyArrow Bill'
lastname: 'williams'
skinnyArrow: -> console.log @firstname
fatArrow: => console.log @firstname
bill.skinnyArrow() #bound to the object in which it's called. hence it returns the firstname property of the "bill" object
@robertwalsh0
robertwalsh0 / coffeeCompile
Created September 13, 2012 22:56
Compile Javascript from Coffeescript in a Particular directory
coffee -c -w -o ../js application.coffee