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
\documentclass{article} | |
\usepackage{fontspec,xeCJK} | |
\usepackage[overlap,CJK]{ruby} | |
\renewcommand{\rubysep}{-0.2ex} | |
\begin{document} | |
これは\ruby{日本語}{にほんご}の\ruby{文章}{ぶんしょう}。 | |
\end{document} |
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 MyAppWeb.ApiCase do | |
use ExUnit.CaseTemplate | |
using(opts) do | |
schema = Keyword.get(opts, :schema, MyAppWeb.Api.Schema) | |
api_path = Keyword.get(opts, :api_path, "/api") | |
quote do | |
@__schema__ unquote(schema) | |
@__api_path__ unquote(api_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
#!/bin/sh | |
DOWNLOAD_URL="https://download.oracle.com/otn-pub/java/jdk/8u271-b09/61ae65e088624f5aaa0b1d2d801acb16/jdk-8u271-linux-x64.tar.gz" | |
wget -c --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" $DOWNLOAD_URL |
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 MyAppWeb.Api.Middleware.FormatPage do | |
@behaviour Absinthe.Middleware | |
def call(%{value: %Scrivener.Page{} = page} = res, _) do | |
%{ | |
entries: data, | |
page_number: page_number, | |
page_size: page_size, | |
total_pages: total_pages, | |
total_entries: total_entries |
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 MyAppWeb.Api.Middleware.RestrictAccess do | |
@behaviour Absinthe.Middleware | |
@moduledoc """ | |
A simple Absinthe middleware to ensure that GraphQL queries or mutations | |
are always run by authorized users. | |
""" | |
def init(default), do: default |
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 MyApp.Application do | |
# See https://hexdocs.pm/elixir/Application.html | |
# for more information on OTP Applications | |
@moduledoc false | |
use Application | |
@migrator if Mix.env() in [:prod, :staging], do: [MyApp.Migrator], else: [] | |
def start(_type, _args) do | |
children = |
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 MyApp.Guards do | |
defguard is_id(id) when is_binary(id) or is_integer(id) | |
end |
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 MyAppWeb.Api.Middleware.LazyPreload do | |
@moduledoc """ | |
Absinthe middleware to preload Ecto associations only if they have | |
been requested. | |
""" | |
require Absinthe.Schema.Notation | |
defmacro lazy_preload(assoc_name) do | |
quote do |
OlderNewer