This file contains hidden or 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
FROM elixir:latest | |
ENV HOME /opt/my_app | |
RUN mkdir -p $HOME | |
WORKDIR $HOME | |
ENV MIX_ENV dev | |
ENV PORT ${PORT:-4000} | |
EXPOSE $PORT |
This file contains hidden or 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 HeroiconWithSurface do | |
@moduledoc """ | |
This assumes https://github.com/tailwindlabs/heroicons has been cloned as a submodule to svgs/heroicons | |
Examples: | |
<#HeroiconWithSurface variant="outline" icon="phone" class="w-5 h-5" /> | |
<%= HeroiconWithSurface.svg({"outline", "phone"}, class: "w-5 h-5") %> | |
""" | |
use SvgIcons, |
This file contains hidden or 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
#!/bin/bash | |
SD=$(dirname $(realpath "$0")) || exit 1 | |
[ `arch` = 'x86_64' ] && url='https://julialang.s3.amazonaws.com/bin/linux/x64/0.5/julia-0.5.2-linux-x86_64.tar.gz' \ | |
|| url='https://julialang.s3.amazonaws.com/bin/linux/x86/0.5/julia-0.5.2-linux-i686.tar.gz' | |
echo $url | |
tmpd="$SD/tmp" |
This file contains hidden or 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
(defvar rotate-text-rotations | |
'( | |
("true" "false") | |
("def" "defp") | |
("if" "else" "unless") | |
("yes" "no")) | |
"List of text rotation sets.") | |
(defun rotate-region (beg end) | |
"Rotate all matches in `rotate-text-rotations' between point and mark." |
This file contains hidden or 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
#!/usr/bin/env ruby | |
def Inherits(*classes) | |
klass = Class.new classes.shift # inherit from the last clas | |
while refine_with = classes.shift # include the others as module refinements just so we can turn them into modules | |
klass.include Module.new { include refine(refine_with) { } } | |
end | |
klass | |
end |
This file contains hidden or 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(a){a.fn.wresize=function(b){function c(){if(a.browser.msie)if(!wresize.fired)wresize.fired=!0;else{var b=parseInt(a.browser.version,10);wresize.fired=!1;if(b<7)return!1;if(b==7){var c=a(window).width();if(c!=wresize.width)return wresize.width=c,!1}}return!0}function d(a){if(c())return b.apply(this,[a])}return version="1.1",wresize={fired:!1,width:0},this.each(function(){this==window?a(this).resize(d):a(this).resize(b)}),this}})(jQuery) |
This file contains hidden or 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
/*--------------------- Layout and Typography ----------------------------*/ | |
body { | |
font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif; | |
font-size: 15px; | |
line-height: 22px; | |
color: #252519; | |
margin: 0; padding: 0; | |
} | |
a { | |
color: #261a3b; |
This file contains hidden or 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
Mustache.to_javascript("Hello {{planet}}") |
This file contains hidden or 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
#in my spec helper | |
def expose(name, &block) | |
exhibitionist = Module.new | |
exhibitionist.send(:define_method, name, &block) | |
view.extend exhibitionist | |
end | |
# in my view spec | |
describe "dashboard/index.html.haml" do | |
it 'renders' do |
This file contains hidden or 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
class MyView < Mustache | |
def cache_by_user_id | |
lambda do |text| | |
cache_key = "user:#{current_user.id}" | |
if value = $cache.get(cache_key) | |
value | |
else | |
rendered = render(text) | |
$cache.set(cache_key, rendered) |
NewerOlder