Skip to content

Instantly share code, notes, and snippets.

View stevedomin's full-sized avatar
🛫
Taking off

Steve Domin stevedomin

🛫
Taking off
View GitHub Profile
@stevedomin
stevedomin / not_working_user_controller.ex
Created October 4, 2014 17:55
Avoid encoding/decoding in controller create
def create(conn, %{"user" => u}) do
user = struct(User, u)
IO.inspect user
# %App.User{created_at: nil, email: nil}
end
@stevedomin
stevedomin / output
Created June 20, 2014 22:20
Dynamo - Elixir 0.14.1 - Failing specs
..............................................................................................
1) test forwarding on root with dynamic path and params (Dynamo.Router.BaseTest)
test/dynamo/router/base_test.exs:167
** (ArgumentError) argument error
stacktrace:
(stdlib) :maps.merge(%{}, [glob: ["12", "hello"]])
(dynamo) lib/dynamo/connection/behaviour.ex:133: Dynamo.Connection.Test.route_params/2
test/dynamo/router/base_test.exs:69: Dynamo.Router.BaseTest.RootSample.dispatch/3
(dynamo) lib/dynamo/http/case.ex:250: Dynamo.HTTP.Case.do_process/2
@stevedomin
stevedomin / 0-before.ex
Created June 5, 2014 15:46
comprehensions in dynamo
defp escape(key) do
bc <<code>> inbits key do
<< if code in [?[, ?], ?{, ?}, ?*, ??] do
<< ?\\, code >>
else
<< code >>
end :: binary >>
end
end
@stevedomin
stevedomin / output
Created April 30, 2014 22:36
MIX_ENV=prod mix compile
_build/prod/
└── lib
├── cowboy
│   └── ebin -> ../../../../deps/cowboy/ebin
├── cowlib
│   ├── ebin -> ../../../../deps/cowlib/ebin
│   └── include -> ../../../../deps/cowlib/include
├── dynamo
│   └── ebin
│   ├── Elixir.Access.Binary.Dict.beam
@stevedomin
stevedomin / mix.exs
Last active September 25, 2022 19:55
simple_dynamo_deploy mix file
defmodule SimpleDynamoDeploy.Mixfile do
use Mix.Project
def project do
[ app: :simple_dynamo_deploy,
version: "0.0.1",
build_per_environment: true,
dynamos: [SimpleDynamoDeploy.Dynamo],
compilers: [:elixir, :dynamo, :app],
deps: deps ]

Keybase proof

I hereby claim:

  • I am stevedomin on github.
  • I am stevedomin (https://keybase.io/stevedomin) on keybase.
  • I have a public key whose fingerprint is 62C7 7024 9CAE 12DA 6D44 206A 12B5 6834 6DE3 9A63

To claim this, I am signing this object:

@stevedomin
stevedomin / gocardless-example.php
Created November 14, 2013 14:12
GoCardless PHP example
<?php
// Include GoCardless
include_once 'gocardless-php/lib/GoCardless.php';
// Set up configuration
$account_details = array(
'app_id' => "",
'app_secret' => "",
'access_token' => "",
'merchant_id' => ""
Using gc_postgresql (0.1.0) at path: '/Users/steve/src/gc/chef/cookbooks/gc_postgresql'
{:method=>:get, :body=>"{\"versions\":[\"http://cookbooks.opscode.com/api/v1/cookbooks/postgresql/versions/3_0_0\",\"http://cookbooks.opscode.com/api/v1/cookbooks/postgresql/versions/2_4_0\",\"http://cookbooks.opscode.com/api/v1/cookbooks/postgresql/versions/2_2_2\",\"http://cookbooks.opscode.com/api/v1/cookbooks/postgresql/versions/2_2_0\",\"http://cookbooks.opscode.com/api/v1/cookbooks/postgresql/versions/2_1_0\",\"http://cookbooks.opscode.com/api/v1/cookbooks/postgresql/versions/2_0_2\",\"http://cookbooks.opscode.com/api/v1/cookbooks/postgresql/versions/2_0_0\",\"http://cookbooks.opscode.com/api/v1/cookbooks/postgresql/versions/1_0_0\",\"http://cookbooks.opscode.com/api/v1/cookbooks/postgresql/versions/0_99_4\",\"http://cookbooks.opscode.com/api/v1/cookbooks/postgresql/versions/0_99_2\",\"http://cookbooks.opscode.com/api/v1/cookbooks/postgresql/versions/0_99_0\",\"http://cookbooks.opscode.com/api/v1/cookbooks/postgresql
@stevedomin
stevedomin / httpheaders.js
Created April 8, 2013 18:00
Config HTTP header
.config(['$httpProvider',
function appConfigHttpProvider($httpProvider) {
$httpProvider.defaults.headers.common.Accept = 'application/json';
}
]);
@stevedomin
stevedomin / emoji_sad.txt
Created November 27, 2012 16:16 — forked from mranney/emoji_sad.txt
Why we can't process Emoji anymore
From: Chris DeSalvo <chris.desalvo@voxer.com>
Subject: Why we can't process Emoji anymore
Date: Thu, 12 Jan 2012 18:49:20 -0800
Message-Id: <AE459007-DF2E-4E41-B7A4-FA5C2A83025F@voxer.com>
--Apple-Mail=_6DEAA046-886A-4A03-8508-6FD077D18F8B
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=utf-8