Skip to content

Instantly share code, notes, and snippets.

View ijunaid8989's full-sized avatar
🇵🇰
It may have escaped your notice but life isn't fair.

Junaid Farooq ijunaid8989

🇵🇰
It may have escaped your notice but life isn't fair.
  • Islamabad Pakistan
View GitHub Profile
WITH active_enforcement AS (
SELECT DISTINCT ON (en.company_id, en.store_id, en.created_at)
en.id,
en.company_id,
en.store_id,
en.enforcement_statuses_id
FROM enforcements en
WHERE en.enforcement_statuses_id IN (1, 2, 3, 4)
ORDER BY en.company_id, en.store_id, en.created_at DESC
),
WITH active_enforcement AS (
SELECT DISTINCT ON (en.company_id, en.store_id, en.created_at)
en.*
FROM enforcements en
WHERE en.enforcement_statuses_id IN (1, 2, 3, 4)
ORDER BY en.created_at DESC
),
active_test_purchase AS (
SELECT DISTINCT ON (tp.company_id, tp.store_id, tp.created_at)
tp.*
SELECT s0."age_id",
Count(s0."id"),
s0."age_bucket"
FROM (
SELECT sm0."id" AS "id",
CASE
WHEN age < 1 THEN 1
WHEN age < 7 THEN 7
WHEN age < 31 THEN 31
ELSE NULL
SELECT s0."age_id",
Count(s0."id"),
s0."age_bucket"
FROM (
SELECT sm0."id" AS "id",
CASE
WHEN age < 1 THEN 1
WHEN age < 7 THEN 7
WHEN age < 31 THEN 31
ELSE NULL
{
"attributes": {
"referrals": null,
"miscarriages": 19,
"notes": [],
"form": {
"id": "9b5716fd-a0bb-47d6-bf23-68b18acc0195",
"type": "medical:form"
},
"room": null,
@ijunaid8989
ijunaid8989 / Howto.md
Created February 1, 2024 20:40 — forked from jeregrine/Howto.md
Setting up Redo and Poolboy for redis connections in Elixir

Then add

worker(Redis, []),

to your supervision tree

warning: variable "seeker_company" is unused (if the variable is not meant to be used, prefix it with an underscore)
lib/nectarine_credit_api/credit/agreement_text.ex:156: NectarineCredit.Credit.AgreementText.personal_guarantee_title_template/1
warning: redefining @doc attribute previously set at line 10.
Please remove the duplicate docs. If instead you want to override a previously defined @doc, attach the @doc attribute to a function head (the function signature not followed by any do-block). For example:
@doc """
new docs
"""
Compiling 128 files (.ex)
warning: variable "assigns" is unused (if the variable is not meant to be used, prefix it with an underscore)
lib/nectarine_credit_api_web/plugs/sentry_context.ex:8: NectarineCreditWeb.Plugs.SentryContext.call/2
warning: variable "last_updated" is unused (if the variable is not meant to be used, prefix it with an underscore)
lib/nectarine_credit_api/external/finicity/auth_token_service.ex:15: NectarineCredit.External.Finicity.AuthTokenService.init/1
warning: variable "token" is unused (if the variable is not meant to be used, prefix it with an underscore)
lib/nectarine_credit_api/external/finicity/auth_token_service.ex:15: NectarineCredit.External.Finicity.AuthTokenService.init/1
==> nectarine_credit_api
Compiling 127 files (.ex)
warning: variable "assigns" is unused (if the variable is not meant to be used, prefix it with an underscore)
lib/nectarine_credit_api_web/plugs/sentry_context.ex:8: NectarineCreditWeb.Plugs.SentryContext.call/2
warning: variable "last_updated" is unused (if the variable is not meant to be used, prefix it with an underscore)
lib/nectarine_credit_api/external/finicity/auth_token_service.ex:15: NectarineCredit.External.Finicity.AuthTokenService.init/1
warning: variable "token" is unused (if the variable is not meant to be used, prefix it with an underscore)
lib/nectarine_credit_api/external/finicity/auth_token_service.ex:15: NectarineCredit.External.Finicity.AuthTokenService.init/1
@ijunaid8989
ijunaid8989 / extract_tar_from_binary.ex
Created September 12, 2022 12:41 — forked from nroi/extract_tar_from_binary.ex
Decompressing a tar.gz archive in Elixir with Erlang's :erl_tar module.
@doc"""
Returns a map containing all files and their contents from the compressed tar archive.
"""
def extract_tar_from_binary(binary) do
with {:ok, files} <- :erl_tar.extract({:binary, binary}, [:memory, :compressed]) do
files
|> Enum.map(fn {filename, content} -> {to_string(filename), content} end)
|> Map.new
end
end