This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var mandrill = require('mandrill-api/mandrill'); | |
| var mandrill_client = new mandrill.Mandrill('YOUR MANDARILL KEY'); | |
| var FROM_EMAIL = '[email protected]'; | |
| var FROM_NAME = 'Our Standup'; | |
| var db = require('./database'); | |
| var invitationsRef = db.ref("invitations"); | |
| var teamsRef = db.ref("teams"); | |
| var usersRef = db.ref("users"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Ember from 'ember'; | |
| export default Ember.Controller.extend({ | |
| appName: 'Ember Twiddle', | |
| names: [{name:'joe'},{name:'emily'},{name:'david'},{name:'daniel'},{name:'mike'}], | |
| sortBy: ['name'], | |
| sortByDesc: ['name:desc'], | |
| sortedNames: Ember.computed.sort('names','sortBy'), | |
| sortedNamesDesc: Ember.computed.sort('names','sortByDesc') | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Ember from 'ember'; | |
| export default Ember.Controller.extend({ | |
| appName: 'Ember Twiddle', | |
| actions: { | |
| sayHello(){ | |
| alert ('Hello World'); | |
| } | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Ember from 'ember'; | |
| export default Ember.Controller.extend({ | |
| appName: 'Ember Twiddle', | |
| articles: Ember.A([ | |
| Ember.Object.create({title:'title 1',status:'active'}), | |
| Ember.Object.create({title:'title 2',status:'draft'}), | |
| Ember.Object.create({title:'title 3',status:'draft'}), | |
| Ember.Object.create({title:'title 4',status:'draft'}), | |
| Ember.Object.create({title:'title 5',status:'active'}), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Ember from 'ember'; | |
| export default Ember.Controller.extend({ | |
| appName: 'Ember Twiddle', | |
| someArray: Ember.A([3,2,4,1]), | |
| maxNumber: Ember.computed.max('someArray'), | |
| newNumber: 5, | |
| actions: { | |
| insertNumber(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Ember from 'ember'; | |
| export default Ember.Controller.extend({ | |
| appName: 'Ember Twiddle', | |
| actions: { | |
| sayHello(){ | |
| alert ("Hello"); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ember new hello-world | |
| cd hello-world | |
| ember install ember-electron | |
| ember electron |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def min [] do 0 end | |
| def min [h|t] do _min [h|t],h end | |
| defp _min [],smallest do smallest end | |
| defp _min [h|t], smallest do | |
| cond do | |
| smallest <= h -> | |
| _min t, smallest | |
| smallest >= h -> | |
| _min t, h |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defp midpoint a,b do div(a+b,2) end | |
| def guess(my_choice, a.._) when my_choice == a do IO.puts "is it #{a}?" end | |
| def guess(my_choice, _..b) when my_choice == b do IO.puts "is it #{b}?" end | |
| def guess(my_choice, a.._) when my_choice < a do IO.puts "out of range" end | |
| def guess(my_choice, _..b) when my_choice > b do IO.puts "out of range" end | |
| def guess(my_choice, a..b) when my_choice > div((a+b),2) do | |
| IO.puts "is it #{midpoint(a,b)}?" | |
| guess my_choice, midpoint(a,b)..b | |
| end | |
| def guess(my_choice, a..b) when my_choice < div((a+b),2) do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def gcd x,0 do x end | |
| def gcd x,y do gcd y, rem(x,y) end |