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
-module(flatten). | |
-export([flatten/1]). | |
flatten(List) -> | |
lists:reverse(flatten_helper(List, [])). | |
flatten_helper([], Flat) -> | |
Flat; |
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
Please use davidw@dedasys.com for the hex.pm maintainers for epgsql, rather than the gmail.com address |
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
%%%------------------------------------------------------------------- | |
%%% @author David N. Welton <davidw@dedasys.com> | |
%%% @copyright (C) 2015, David N. Welton | |
%%% @doc | |
%%% | |
%%% @end | |
%%% Created : 13 Feb 2015 by David N. Welton <davidw@dedasys.com> | |
%%%------------------------------------------------------------------- | |
-module(codesize). |
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
-module(walkapp). | |
-export([walk/1]). | |
walk(AppName) -> | |
Pid = application_controller:get_master(AppName), | |
walk_internal([Pid], sets:new()). | |
walk_internal([], Seen) -> | |
error_logger:info_msg("done!"), |
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 Version.clean_duplicates | |
Document.all.each do |d| | |
puts "document #{d.id}" | |
oldv = nil | |
toreap = [] | |
d.versions.select([:id, :created_at]).each do |v| | |
v.reload | |
if !oldv.nil? && !oldv.content.nil? && !v.content.nil? && | |
oldv.content.size == v.content.size && oldv.content == v.content |
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
start() -> | |
loop(0, 0, 0, right, down). | |
loop(200, _, _, _, _) -> | |
ok; | |
loop(Counter, LastX, LastY, DirX, DirY) -> | |
{ok, Cols} = io:columns(), | |
{ok, Rows} = io:rows(), | |
{NewX, NewY, NewDirX, NewDirY} = move(LastX, LastY, DirX, DirY, Cols, Rows), |
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
all: priv/report_templates/*_report_template/dist/prefixed.css | |
priv/report_templates/foo_report_template/dist/all.css: $(wildcard priv/report_templates/foo_report_template/stylesheets/*.css) $(wildcard priv/report_templates/common/stylesheets/*.css) | |
cat $^ > $@ | |
priv/report_templates/bar_report_template/dist/all.css: $(wildcard priv/report_templates/bar_report_template/stylesheets/*.css) $(wildcard priv/report_templates/common/stylesheets/*.css) | |
cat $^ > $@ | |
priv/report_templates/foo_report_template/dist/prefixed.css: priv/report_templates/foo_report_template/dist/all.css | |
priv/autoprefixer/node_modules/autoprefixer/bin/autoprefixer --browsers ${AUTOPREFIXER_BROWSERS} -o $@ priv/report_templates/foo_report_template/dist/all.css |
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
-heart | |
-setcookie mycookie | |
-name myweb@localhost.localdomain | |
-kernel net_ticktime 10 | |
-env ERL_CRASH_DUMP_SECONDS=-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
=proc:<0.6.0> | |
State: Running | |
Name: error_logger | |
Spawned as: proc_lib:init_p/5 | |
Last scheduled in for: gen_event:handle_msg/5 | |
Spawned by: <0.2.0> | |
Started: Wed Jul 2 11:45:41 2014 | |
Message queue length: 1 | |
Number of heap fragments: 0 | |
Heap fragment data: 0 |
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
lager:info("Running migration: ~p~n", [Tag]), | |
try | |
Res = Fun(Direction), | |
error_logger:info_msg("Result is ~p~n", [Res]) | |
catch | |
Error -> | |
error_logger:error_msg("Error in ~p ~p~n", [Tag, Error]) | |
%% throw(Error) | |
end, |
NewerOlder