This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'active_record/connection_adapters/postgresql/schema_statements' | |
# | |
# Monkey-patch the refused Rails 4.2 patch at https://github.com/rails/rails/pull/31330 | |
# | |
# Updates sequence logic to support PostgreSQL 10. | |
# | |
# Monkey patch developed by @replaid: https://github.com/rails/rails/issues/28780#issuecomment-354868174 | |
# put into config/initializers or some other early-loading code. | |
# config/initializers/backport_pg_10_support_to_rails_4.rb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check if mjml is installed | |
if ! [ -x "$(command -v mjml)" ]; then | |
echo 'Error: mjml is not installed. Install with "npm install -g mjml"' >&2 | |
exit 1 | |
fi | |
# Check if html-to-text is installed | |
if ! [ -x "$(command -v html-to-text)" ]; then | |
echo 'Error: html-to-text is not installed. Install with "npm install -g html-to-text"' >&2 | |
exit 1 | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const agentInfo = { | |
offline: { | |
on: { | |
ONLINE: 'online', | |
GROUP: 'group' | |
} | |
}, | |
group: { | |
on: { | |
ONLINE: 'online', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: Promise.all([ | |
import("https://unpkg.com/[email protected]?module"), | |
import("https://unpkg.com/@tehshrike/[email protected]"), | |
]).then(([{ default: Turndown }, { default: Readability }]) => { | |
const vault = ""; /* Optional vault name */ | |
const folder = prompt( | |
"Folder: ", | |
"Clippings/", | |
); /* Optional folder name such as "Clippings/" */ | |
const tags = `#clippings ${prompt("Tags", "#to_read")}`; /* Optional tags */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright 2017 Google LLC | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* https://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mix.install([ | |
{:benchee, "~> 1.0"} | |
]) | |
no_duplicates = [Enum.map(1..10_000, &to_string/1)] | |
all_duplicates = [no_duplicates, no_duplicates] | |
some_duplicates = [no_duplicates, Enum.map(300..700, &to_string/1)] | |
one_duplicate = [no_duplicates, "700"] | |
minus_minus = fn headers -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule AsyncAssigns do | |
import Phoenix.LiveView, only: [connected?: 1, assign: 2, assign: 3] | |
@doc """ | |
Provides ability to assign default values to the socket, and kick off a | |
process that will send a message to the LiveView. The message payload will | |
be assigned as specified. | |
## Usage | |
Add the following lines to a specific LiveView, or to the web module |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: bug | |
allowed: | |
- mit | |
apps: | |
- source_path: . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Discussed in https://www.ericpfahl.com/from-pattern-matching-to-unification/ | |
defmodule Var do | |
alias Var | |
@type t :: %Var{id: any} | |
defstruct [:id] | |
@spec new(any) :: Var.t() | |
def new(id), do: %Var{id: id} |
OlderNewer