Skip to content

Instantly share code, notes, and snippets.

View marcusgadbem's full-sized avatar

Marcus Gadbem marcusgadbem

View GitHub Profile
@marcusgadbem
marcusgadbem / mokable_task.ex
Created October 23, 2023 15:48 — forked from nuxlli/mokable_task.ex
A mockable Task module for elixir (with mox)
# lib/my_project/task.ex
defmodule MyProject.Task do
@moduledoc """
TODO: run async task on tests will not work, with unpredictable side effects
"""
@adapter Keyword.get(
Application.compile_env(:my_project, __MODULE__, []),
:adapter,
Task
@marcusgadbem
marcusgadbem / adapter-dynamodb.ts
Last active November 8, 2022 20:36
aws-sdk - dynamodb client + test
import { DynamoDBClient, DynamoDBClientConfig } from '@aws-sdk/client-dynamodb'
import { DynamoDBDocumentClient } from '@aws-sdk/lib-dynamodb'
// @aws-sdk (v3) has keepAlive enabled by default
export const DynamoClient = new DynamoDBClient({});
const marshallOptions = {
convertEmptyValues: false,
removeUndefinedValues: false,
convertClassInstanceToMap: false,
@marcusgadbem
marcusgadbem / keybase.md
Created July 14, 2020 13:48
Keybase verification

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@marcusgadbem
marcusgadbem / errors.js
Created September 28, 2015 17:33
React component pattern with a Store
export class APIRateLimitError extends Error {
constructor(err) {
super('API Rate limit.');
}
}
@marcusgadbem
marcusgadbem / Azkfile.js
Last active August 29, 2015 14:16
UMRUM - Azkfile
/**
* Documentation: http://docs.azk.io/Azkfile.js
*/
// Adds the systems that shape your system
systems({
umrum: {
// Dependent systems
depends: ["redis", "mongodb"],
// More images: http://images.azk.io
@marcusgadbem
marcusgadbem / development.rb
Created October 11, 2014 20:50
unicorn in development
# config/environments/development.rb
MyApp::Application.configure do
# Tell Rails to log to STDOUT instead Rails::Rack::LogTailer
config.logger = Logger.new(STDOUT)
config.logger.level = Logger.const_get(
ENV['LOG_LEVEL'] ? ENV['LOG_LEVEL'].upcase : 'DEBUG'
)
end
@marcusgadbem
marcusgadbem / Gruntfile.js
Created August 14, 2014 22:31
grunt-concurrent with nodemon and watch
/* globals module */
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
watch: {
gruntfile: {
@marcusgadbem
marcusgadbem / rails_resources.md
Created July 6, 2014 20:13 — forked from jookyboi/rails_resources.md
Rails-related Gems and guides to accelerate your web project.

Gems

  • Bundler - Bundler maintains a consistent environment for ruby applications. It tracks an application's code and the rubygems it needs to run, so that an application will always have the exact gems (and versions) that it needs to run.
  • rabl - General ruby templating with json, bson, xml, plist and msgpack support
  • Thin - Very fast and lightweight Ruby web server
  • Unicorn - Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.
  • SimpleCov - SimpleCov is a code coverage analysis tool for Ruby 1.9.
  • Zeus - Zeus preloads your Rails app so that your normal development tasks such as console, server, generate, and specs/tests take less than one second.
  • [factory_girl](h
@marcusgadbem
marcusgadbem / javascript_resources.md
Created July 6, 2014 20:13 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage