git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
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
import System.Random | |
randomCells :: Int -> StdGen -> [Int] | |
randomCells size gen = take size $ randomRs (0, 1) gen | |
createGeneration :: [Int] -> Int -> [[Int]] -> [[Int]] | |
createGeneration [] _ generation = generation -- use _ when you don't use a variable | |
createGeneration cells width generation = | |
let line = take width cells | |
in createGeneration (drop width cells) width (line:generation) |
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
(function($) { | |
var elCount = {}; | |
var finishedCount = {}; | |
$.fn.graphite = function(options) { | |
for(var i=0; i < $(this).length; i++){ | |
$this = $(this[i]); | |
elCount[$this.attr('id')] = 0; | |
finishedCount[$this.attr('id')] = 0; | |
params = $.fn.graphite.initParams($this, options); |
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
λ erl -pa ebin deps/*/ebin | |
{error_logger,{{2014,9,4},{14,53,53}},"~s~n",["Error in process <0.23.0> with exit value: {undef,[{group,start,[<0.23.0>,{}],[]},{user_drv,start_user,0,[{file,\"user_drv.erl\"},{line,154}]},{user_drv,server1,3,[{file,\"user_drv.erl\"},{line,114}]}]}\n"]} | |
{error_logger,{{2014,9,4},{14,54,3}},crash_report,[[{initial_call,{supervisor_bridge,user_sup,['Argument__1']}},{pid,<0.22.0>},{registered_name,[]},{error_info,{exit,nouser,[{gen_server,init_it,6,[{file,"gen_server.erl"},{line,322}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]}},{ancestors,[kernel_sup,<0.10.0>]},{messages,[]},{links,[<0.11.0>]},{dictionary,[]},{trap_exit,true},{status,running},{heap_size,610},{stack_size,27},{reductions,346}],[]]} | |
{error_logger,{{2014,9,4},{14,54,3}},supervisor_report,[{supervisor,{local,kernel_sup}},{errorContext,start_error},{reason,nouser},{offender,[{pid,undefined},{name,user},{mfargs,{user_sup,start,[]}},{restart_type,temporary},{shutdown,2000},{child_type,supervisor}]}]} | |
{ |
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
'use strict'; | |
angular.module('simpleQuery', []) | |
.value('simpleQueryJSON', { | |
"some_big_json": "foo" | |
} | |
); | |
And in my test: | |
beforeEach(module('moduleFoo', 'simpleQuery')); |
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
describe('Testing Login', function() { | |
beforeEach(function(){ | |
browser().navigateTo('/'); | |
input('login.login').enter('user'); | |
input('login.password').enter('secure_password'); | |
}); | |
it('should login', function() { | |
element('#login').click(); |
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
(defun restclient-http-send-current-and-stay-in-current-buffer () | |
"Standard RESTClient C-c C-c but stays in current buffer" | |
(interactive) | |
(restclient-http-send-current) | |
(other-window -1) | |
) |
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
-include_lib("eunit/include/eunit.hrl"). | |
-module(simple_server). | |
-export([start/0]). | |
basic_test_() -> | |
{"Test quit message", | |
fun() -> | |
simple_server:start(), | |
?assertEqual("Quit command received. Closing down server", simple_server ! "quit") | |
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
| top margin | | |
| [label] | | |
| [label2] [label3] | | |
| [button] | | |
| bottom margin | |
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
WallInfo = Struct.new(:api_key, :params) | |
wall = ["apikey", {page_id: 4, token: "token", server: "factory"}] | |
info = WallInfo.new(*wall) | |
info.api_key = "api_key" | |
info.params = {page_id: 4, token: "token", server: "factory"} | |
much better than info.first or info[0]... |