This file contains 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
App.UrlNewRoute = Ember.Route.extend({ | |
setupController: function(controller, model) { | |
console.dir(1); | |
return this.store.find('UrlType').then(function(url_types) { | |
return console.dir(url_types); | |
}); | |
} | |
}); |
This file contains 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
func LoginCommand(c *cli.Context) { | |
a, _ := getInput("Plain input: ") | |
fmt.Println(a) | |
a, _ = getInput("Hidden input: ", true) | |
fmt.Println(a) | |
} | |
func getInput(a ...interface{}) (text string, err error) { | |
var isHidden bool | |
if len(a) == 2 { |
This file contains 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
func LoginCommand(c *cli.Context) string, error { | |
var password, account string | |
var err error | |
account = c.Args()[0] | |
if len(c.Args()) == 0 { | |
fmt.Print("Account: ") | |
if _, err = fmt.Scanln(&account); err == nil { | |
fmt.Print("Password: ") | |
_, err = fmt.Scanln(&password) | |
} |
This file contains 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
package main | |
import ( | |
"github.com/codegangsta/cli" | |
"log" | |
) | |
func LoginCommand(c *cli.Context) { | |
//it must be available here | |
println(debugFlag) |
This file contains 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
Error: Attempted to handle event `didSetProperty` on <Seotool.Url:ember634:null> while in state root.deleted.saved. Called with {name: destination, oldValue: undefined, originalValue: undefined, value: undefined}. |
This file contains 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
Testcase.AlbumTracksRoute = Ember.Route.extend | |
model: -> | |
@modelFor('album').get('tracks') |
This file contains 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 other_function | |
accept_two_arguments({foo: 1, bar: 2}) | |
end | |
def accepts_two_arguments(first, second) | |
puts first, second | |
end |
This file contains 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
% A customer enters, sees our menu and asks if he could have the prices of all the items costing between $3 and $10 with taxes % (say 7%) counted in afterwards. | |
3> RestaurantMenu = [{steak, 5.99}, {beer, 3.99}, {poutine, 3.50}, {kitten, 20.99}, {water, 0.00}]. | |
[{steak,5.99}, | |
{beer,3.99}, | |
{poutine,3.5}, | |
{kitten,20.99}, | |
{water,0.0}] | |
4> [{Item, Price*1.07} || {Item, Price} <- RestaurantMenu, Price >= 3, Price =< 10]. |
This file contains 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
{- | |
Prelude> :t [['a','b','c'],['d','e']] | |
[['a','b','c'],['d','e']] :: [[Char]] | |
Prelude> head [['a','b','c'],['d','e']] | |
"abc" | |
Prelude> head (head [['a','b','c'],['d','e']]) | |
'a' | |
Prelude> head [[]] | |
[] | |
1. Rewrite the previous list literals using only (:) and the empty list constructor []. |
This file contains 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 entities = { | |
address: 1, | |
block: 2, | |
transaction: 3, | |
}; | |
entities.humanize = function (id) { | |
switch (id) { | |
case 1: | |
return 'address'; | |
case 2: |
OlderNewer