Skip to content

Instantly share code, notes, and snippets.

Avatar

Mario Uher ream88

View GitHub Profile
@ream88
ream88 / index.html
Created Sep 23, 2021
Drop this into any website to play around with #Safari15 themed tabs!
View index.html
<meta name="theme-color" content="#29B8FF" />
<input type="color" value="#29B8FF" id="colorPicker" />
<script>
const colorPicker = document.getElementById("colorPicker")
colorPicker.addEventListener("change", function() {
document
.querySelector("meta[name=theme-color]")
.setAttribute("content", colorPicker.value)
@ream88
ream88 / simplify_tracker_blocking.js
Created Mar 4, 2021
List of email spy pixels blocked by Simplify Gmail as of Feb 28, 2021
View simplify_tracker_blocking.js
const trackers = {
"365offers.trade": "trk.365offers.trade",
"Absolutesoftware-email.com": "click.absolutesoftware-email.com\\/open.aspx",
"ActiveCampaign.com": "lt.php(.*)\\?l=open",
"ActionKit.com": "track.sp.actionkit.com\\/q\\/",
"Acoustic.com": "mkt\\d{4,5}.com/open",
"Adobe.com": [
"demdex.net",
"t.info.adobesystems.com",
"toutapp.com",
@ream88
ream88 / tracker_blocking.rb
Created Mar 4, 2021 — forked from dhh/tracker_blocking.rb
Current list of spy pixels named'n'shamed in HEY, as of April 23, 2020
View tracker_blocking.rb
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",
@ream88
ream88 / ShortUUID.elm
Created Oct 8, 2020
ShortUUID decode and encode in Elm
View ShortUUID.elm
module ShortUUID exposing (decode, encode)
import BigInt exposing (BigInt)
import List.Extra as List
import String.Extra as String
abc : List Char
abc =
[ '1', '2', '3', '4', '5', '6', '7', '8', '9' ]
@ream88
ream88 / curry.ex
Created Aug 17, 2019
Curried functions in Elixir
View curry.ex
defmodule Curry do
defmacro curry([{name, arity}]) do
(arity - 1)
|> Range.new(0)
|> Enum.map(fn arity ->
arguments =
Range.new(0, arity)
|> Enum.filter(&(&1 > 0))
|> Enum.map(&"a#{&1}")
|> Enum.map(&String.to_atom/1)
@ream88
ream88 / sync_or_async.exs
Created Aug 31, 2018
GenStage sync and async
View sync_or_async.exs
events = 1..5
defmodule SyncOrAsync do
use GenStage
def start_link(mode) when mode == :async or mode == :sync do
GenStage.start_link(__MODULE__, mode, name: __MODULE__)
end
# GenStage API
@ream88
ream88 / .gitignore
Last active Aug 6, 2017
Working Popup example
View gist:4f4e07ddce88632ad73ea846d4a338d3
01234567-89ab-cdef-0123-456789abcdef
@ream88
ream88 / Child1.elm
Created Jul 20, 2017
Elm communication
View Child1.elm
module Child1 exposing (Msg(..), Model, init, update)
import WebData exposing (..)
type Msg
= Response (WebData (List String))
type alias Model =
@ream88
ream88 / ssl_puma.sh
Created Oct 10, 2016 — forked from tadast/ssl_puma.sh
localhost SSL with puma
View ssl_puma.sh
# 1) Create your private key (any password will do, we remove it below)
$ cd ~/.ssh
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key