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
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
// Copyright (c) 2018 A Bit of Help, Inc. - All Rights Reserved, Worldwide. | |
// Use of this source code is governed by a MIT license that can be found in the LICENSE file. | |
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
// Package main implements streaming of a file through a buffered channel where it is written to a new file. | |
// A data race condition arose in the for loop that reads data from the input file and sending it to the channel. | |
// I moved the allocation of the buffer to the top of the loop, to resolve the data race issue. | |
// I've created a companion gist,"go-stream-file-between-goroutines-with-pipe" that resolves the race issue using a | |
// FIFO pipe. It worked, but the price was that it was slower than using a channel. |
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
UI: | |
- https://github.com/rivo/tview | |
- https://github.com/fyne-io/fyne | |
PacketDecoding: | |
- https://github.com/kgolding/go-decoder | |
Testing: | |
- https://github.com/stretchr/testify |
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
# lib/monitor.ex | |
defmodule MyApp.Monitor do | |
def health_check do | |
ExStatsD.histogram(get_concache_mem_size(:css_cache), "css.cache.memory", ["css_cache_memory"]) | |
ExStatsD.histogram(get_concache_mem_size(:sass_cache), "sass.cache.memory", ["sass_cache_memory"]) | |
ExStatsD.histogram(ConCache.size(:css_cache), "css.cache.size", ["css_cache_size"]) | |
ExStatsD.histogram(ConCache.size(:sass_cache), "sass.cache.size", ["sass_cache_size"]) | |
ExStatsD.histogram(:erlang.memory(:ets), "erlang.ets.memory", ["ets_size"]) | |
ExStatsD.histogram(:erlang.memory |> Keyword.get(:total), "erlang.memory.memory", ["ets_size"]) |
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
defmodule Monitor do | |
def health_check do | |
ExStatsD.histogram(get_concache_mem_size(:css_cache), "css.cache.memory", ["css_cache_memory"]) | |
ExStatsD.histogram(get_concache_mem_size(:sass_cache), "sass.cache.memory", ["sass_cache_memory"]) | |
ExStatsD.histogram(ConCache.size(:css_cache), "css.cache.size", ["css_cache_size"]) | |
ExStatsD.histogram(ConCache.size(:sass_cache), "sass.cache.size", ["sass_cache_size"]) | |
ExStatsD.histogram(:erlang.memory(:ets), "erlang.ets.memory", ["ets_size"]) | |
ExStatsD.histogram(:erlang.memory |> Keyword.get(:total), "erlang.memory.memory", ["ets_size"]) | |
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
@doc """ | |
Converts Elixir map into a sass map | |
""" | |
def convert_to_sass(map) when is_map(map) do | |
"(" <> Enum.map_join(map, ",", fn {k, v} -> | |
"#{convert_to_sass(k)}:#{convert_to_sass(v)}" | |
end) <> ")" | |
end | |
@doc """ | |
Converts Elixir atom into its corresponding sass value |
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
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css"> | |
<section class='display-pane-container'> | |
<div class='media' style='max-width:1200px;'> | |
<div class='photo'> | |
<img src='http://placecage.com/1200/700' class='player-photo' /> | |
</div> | |
<div class='left-control'> | |
<span class='fa fa-arrow-circle-o-left fa-3x'></span> | |
</div> | |
<div class='right-control'> |
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
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css"> | |
<section class='display-pane-container'> | |
<div class='media' style='max-width:700px;max-height:1200px;'> | |
<div class='photo'> | |
<img src='http://placecage.com/700/1200' class='player-photo' /> | |
</div> | |
<div class='photo ng-hide'> | |
<img src='http://placecage.com/1200/700' class='player-photo' /> | |
</div> | |
<div class='left-control'> |
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
<div class='container'> | |
<div class='agent'> | |
<div class='profile content'> | |
<img src='http://www.placecage.com/200/300' /> | |
</div> | |
<div class='logo content'> | |
<img src='http://www.placecage.com/200/125' /> | |
</div> | |
<div class='name content'> | |
<p>Nick Cage</p> |
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
<div class='container'> | |
<div class='agent'> | |
<div class='profile'> | |
<img src='http://www.placecage.com/200/300' /> | |
</div> | |
</div> | |
<div class='agent'> | |
<div class='profile'> | |
<img src='http://www.placecage.com/200/300' /> | |
</div> |
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
// ---- | |
// libsass (v3.1.0) | |
// ---- | |
// We are generating this in forceBase.scss: | |
$spacing-xxx-small: 0.125rem; | |
$spacing-xx-small: 0.25rem; | |
$spacing-x-small: 0.5rem; | |
$spacing-small: 0.75rem; | |
$spacing-medium: 1rem; |
NewerOlder