Skip to content

Instantly share code, notes, and snippets.

View dschniepp's full-sized avatar
👷‍♂️
Building

Daniel Schniepp dschniepp

👷‍♂️
Building
View GitHub Profile
@dhh
dhh / tracker_blocking.rb
Last active June 30, 2024 14:35
Current list of spy pixels named'n'shamed in HEY, as of April 23, 2020
module Entry::TrackerBlocking
extend ActiveSupport::Concern
included do
has_many :blocked_trackers
end
email_service_blockers = {
"ActiveCampaign" => /lt\.php(.*)?l\=open/,
"AWeber" => "openrate.aweber.com",
@j2doll
j2doll / beautiful.c
Created August 9, 2019 02:16
[beautiful code] A Regular Expression Matcher : Brian Kernighan & Rob Pike
// http://genius.cat-v.org/brian-kernighan/articles/beautiful
// c matches any literal character c
// . matches any single character
// ^ matches the beginning of the input string
// $ matches the end of the input string
// * matches zero or more occurrences of the previous character
/* match: search for regexp anywhere in text */
int match(char *regexp, char *text)
@swalkinshaw
swalkinshaw / tutorial.md
Last active November 13, 2023 08:40
Designing a GraphQL API
@aptinio
aptinio / factory.ex
Created February 9, 2018 09:25
Roll your own factory for Ecto
defmodule Foo.Factory do
alias Foo.Blog.{Post, Comment}
def params_for(Post) do
%{
title: Faker.Lorem.sentence(),
body: Faker.Lorem.paragraph()
}
end
@CodeMyUI
CodeMyUI / fullscreen-expanding-div.markdown
Created November 9, 2017 09:11
Fullscreen Expanding Div
@reinink
reinink / in-memory-sqlite-database.php
Created September 26, 2017 00:13
Give users completely safe sandboxed raw SQL reporting abilities
<?php
// Create in-memory SQLite database
$sqlite = new PDO('sqlite::memory:');
// Generate schema (for whatever tables you want)
$sqlite->prepare('CREATE TABLE users(id, family_id, first_name, last_name, email)')->execute();
$sqlite->prepare('CREATE TABLE families(id, name, phone, address)')->execute();
// Insert pre-defined data
@maierru
maierru / OTP
Last active December 13, 2019 13:10
Phoenix (elixir) highload optimization
# Move erts IO Polling to dedicated threads
# https://github.com/erlang/otp/pull/1552
@bsedat
bsedat / Dockerfile
Last active August 8, 2023 05:56
Elixir Phoenix Umbrella App + Distillery Multistage Docker Build
FROM elixir:1.4.5 as asset-builder-mix-getter
ENV HOME=/opt/app
RUN mix do local.hex --force, local.rebar --force
# Cache elixir deps
COPY config/ $HOME/config/
COPY mix.exs mix.lock $HOME/
COPY apps/myproject_web/mix.exs $HOME/apps/myproject_web/
COPY apps/myproject_web/config/ $HOME/apps/myproject_web/config/
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active November 17, 2024 19:47
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example