Skip to content

Instantly share code, notes, and snippets.

Scott Davis scottdavis

Block or report user

Report or block scottdavis

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View monitor.ex
# 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"])
View monitor.ex
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
View recursion.ex
@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
@scottdavis
scottdavis / SassMeister-input-HTML.html
Created Sep 25, 2015
Generated by SassMeister.com.
View SassMeister-input-HTML.html
<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'>
@scottdavis
scottdavis / SassMeister-input-HTML.html
Created Sep 24, 2015
Generated by SassMeister.com.
View SassMeister-input-HTML.html
<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'>
@scottdavis
scottdavis / SassMeister-input-HTML.html
Last active Aug 29, 2015
Generated by SassMeister.com.
View SassMeister-input-HTML.html
<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>
@scottdavis
scottdavis / SassMeister-input-HTML.html
Created Aug 4, 2015
Generated by SassMeister.com.
View SassMeister-input-HTML.html
<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>
@scottdavis
scottdavis / SassMeister-input.scss
Created May 1, 2015
Generated by SassMeister.com.
View SassMeister-input.scss
// ----
// 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;
@scottdavis
scottdavis / SassMeister-input.scss
Created Apr 21, 2015
Generated by SassMeister.com.
View SassMeister-input.scss
// ----
// Sass (v3.4.12)
// Compass (v1.0.3)
// ----
$config: (
color-red: red,
color-blue: blue,
color-black: black,
color-white: white,
@scottdavis
scottdavis / SassMeister-input.scss
Last active Aug 29, 2015
Generated by SassMeister.com.
View SassMeister-input.scss
// ----
// libsass (v3.1.0)
// ----
$config: (
"color-red": red,
"color-blue": blue,
"color-black": black,
"color-white": white,
"font-body": 16px,
You can’t perform that action at this time.