Skip to content

Instantly share code, notes, and snippets.

package main
import (
"github.com/codegangsta/cli"
"log"
)
func LoginCommand(c *cli.Context) {
//it must be available here
println(debugFlag)
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}.
Testcase.AlbumTracksRoute = Ember.Route.extend
model: ->
@modelFor('album').get('tracks')
def other_function
accept_two_arguments({foo: 1, bar: 2})
end
def accepts_two_arguments(first, second)
puts first, second
end
@lessless
lessless / 1.erl
Last active August 29, 2015 14:02
% 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].
{-
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 [].
@lessless
lessless / d1.js
Last active August 29, 2015 14:05
var entities = {
address: 1,
block: 2,
transaction: 3,
};
entities.humanize = function (id) {
switch (id) {
case 1:
return 'address';
case 2:
@lessless
lessless / 0_reuse_code.js
Last active August 29, 2015 14:06
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
main :: Int -> Int -> IO
main x y = putStrLn (show (x+y))
-- Compilation error main.hs:2:23: Expecting one more argument to `IO' In the type signature for `main': main :: Int -> Int -> IO
// $npm install --save-dev ember-cli-content-security-policy
//config/environment.js
module.exports = function(environment) {
var ENV = {
contentSecurityPolicy: {
'script-src': "'self' 'unsafe-eval'",
'style-src': "'self' 'unsafe-inline'"
}
};