Skip to content

Instantly share code, notes, and snippets.

View bcardarella's full-sized avatar
Out sailing

Brian Cardarella bcardarella

Out sailing
View GitHub Profile

Section

# The dependency chain is a bit complex, but think of Foo and a

defmodule Lib.Foo do
  defmacro __using__(opts) do
    quote do
      @foo_opts unquote(opts)
 @before_compile Lib.Foo
@bcardarella
bcardarella / .bash_profile
Created February 4, 2009 22:25
Git Autocompletion
source ~/.git-completion.sh
alias gco='git co'
alias gci='git ci'
alias grb='git rb'

LiveView Native Livebook

Mix.install(
  [
    {:plug_cowboy, "~> 2.5"},
    {:jason, "~> 1.0"},
    {:phoenix, "~> 1.7.2", override: true},
    {:phoenix_live_view, "~> 0.18.2"},
    {:phoenix_live_reload, "~> 1.4.1", override: true},
// Released under MIT license
// Copyright (c) 2009-2010 Dominic Baggott
// Copyright (c) 2009-2010 Ash Berlin
// Copyright (c) 2011 Christoph Dorn <christoph@christophdorn.com> (http://www.christophdorn.com)
/*jshint browser:true, devel:true */
(function( expose ) {
/**
@bcardarella
bcardarella / env.rb
Created January 26, 2009 00:06 — forked from jeffrafter/env.rb
Some good Cucumber Stories for Signup and Authentication
ENV["RAILS_ENV"] = "test"
require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
require 'shoulda'
require 'webrat'
require 'factory_girl'
require 'test/factories/clearance'
require 'clearance/../../shoulda_macros/clearance'
require 'cucumber/rails/world'
Cucumber::Rails.use_transactional_fixtures
---
:UY: Uruguay
:NP: Nepal
:BS: Bahamas
:HT: Haiti
:LK: Sri Lanka
:SE: Sweden
:DZ: Algeria
:TW: Taiwan
:GU: Guam
module ActiveSupport::Concern
def append_features(base)
if base.instance_variable_defined?("@_dependencies")
base.instance_variable_get("@_dependencies") << { :module => self, :method => :include }
return false
else
return false if base < self
@_dependencies.each { |dep| base.send(dep[:method], dep[:module]) }
super
base.extend const_get("ClassMethods") if const_defined?("ClassMethods")
!!! Strict
%html{:xmlns => 'http://www.w3.org/1999/xhtml'}
%head
%meta{'http-equip' => 'Content-Type', :content => 'text/html; charset=utf-8'}
%meta{:name => 'viewport', :content => 'widt=device-width, initial-scale=1.0'}
%title= subject
:css
/* Based on The MailChimp Reset INLINE: Yes. */
/* Client-specific Styles */
#outlook a {padding:0;} /* Force Outlook to provide a "view in browser" menu link. */

Regenerating SSL Cert

cd ssl
rm -rf *
openssl req \
    -newkey rsa:2048 \
    -x509 \
    -nodes \
 -keyout server.key \
** (MatchError) no match of right hand side value: {:error, {{:EXIT, {:undef, [{Comet.ChromeWorker, :start_link, [[name: :"test get object"]], []}, {:supervisor, :do_start_child, 2, [file: 'supervisor.erl',line: 365]}, {:supervisor, :handle_start_child, 2, [file: 'supervisor.erl', line: 724]}, {:supervisor, :handle_call, 3, [file: 'supervisor.erl', line: 422]}, {:gen_server, :try_handle_call, 4, [file: 'gen_server.erl', line: 615]}, {:gen_server, :handle_msg, 5, [file: 'gen_server.erl', line: 647]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 247]}]}}, {:child, :undefined, Comet.ChromeWorker, {Comet.ChromeWorker, :start_link, [[name: :"test get object"]]}, :permanent, 5000, :worker, [Comet.ChromeWorker]}}}