Skip to content

Instantly share code, notes, and snippets.

View capitalist's full-sized avatar
🎯
Focusing

Joe Martinez capitalist

🎯
Focusing
View GitHub Profile
# Rails production setup via SQLite3 made durable by https://litestream.io/
# Copy this to Dockerfile on a fresh rails app. Deploy to fly.io or any other container engine.
#
# try locally: docker build . -t rails && docker run -p3000:3000 -it rails
#
# in production you might want to map /data to somewhere on the host,
# but you don't have to!
#
FROM ruby:3.0.2
@novaugust
novaugust / 1_rewriting_a_codebase_with_sourceror.exs
Last active March 1, 2023 21:35
Credo Rewrites Via Sourceror
# for an example of a suggested `locals_without_parens`, see z_locals_without_parens.exs
# parsing and expanding a formatter.exs file would be a good route too
opts = [sourceror_opts: [locals_without_parens: [...], line_length: 122]]
for transformation <- [&PipeChainStart.run/1, &SinglePipe.run/1] do
ProjTraversal.transform("../my_codebase/", transformation, opts)
end
@slotrans
slotrans / history_stuff.sql
Created August 6, 2021 23:50
Building blocks for generic history-keeping in Postgres.
/*
Replace "your_schema" with whatever schema is appropriate in your environment.
It is possible to use "public"... but you shouldn't!
*/
/*
Function to stamp a "modified" timestamp. Adjust the name to suit your environment,
but that name is hard-coded so it is assumed that you only use _one_ such name.
@henrik
henrik / example.ex
Created August 29, 2020 20:14
Elixir "@foo bar" macro example
defmodule MyMacro do
defmacro @{name, _meta, [arg]} do
IO.inspect "Your #{name} is a #{arg}"
end
defmacro __using__(_) do
quote do
import Kernel, except: [@: 1]
import unquote(__MODULE__)
end
@lnr0626
lnr0626 / heroicons_with_surface.ex
Last active October 17, 2020 13:37
A module for handling svg icons both with and without surface
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,
@IanColdwater
IanColdwater / twittermute.txt
Last active April 22, 2024 17:26
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
name: Elixir CI
on: push
jobs:
build:
runs-on: ubuntu-latest
container:
@wesyoung
wesyoung / circleci-2.0-eb-deployment.md
Created April 13, 2018 17:54 — forked from ryansimms/circleci-2.0-eb-deployment.md
Deploying to Elastic Beanstalk via CircleCi 2.0

Deploying to Elastic Beanstalk via CircleCi 2.0

I got to here after spending hours trying to deploy to an Elastic Beanstalk instance via CircleCi 2.0 so I thought I'd write up what worked for me to hopefully help others. Shout out to RobertoSchneiders who's steps for getting it to work with CircleCi 1.0 were my starting point.

For the record, I'm not the most server-savvy of developers so there may be a better way of doing this.

Setup a user on AWS IAM to use for deployments

@steven2358
steven2358 / ffmpeg.md
Last active April 21, 2024 02:08
FFmpeg cheat sheet