config before deleting eglot
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
# key: ecto-seed
|
||||
# name: Ecto seed table
|
||||
# --
|
||||
alias ${1:App}.${2:Context}
|
||||
|
||||
${3:instance}s = [
|
||||
%{name: "Chess", description: "The classic strategy game", sku: 5_678_910, unit_price: 10.00},
|
||||
%{
|
||||
name: "Tic-Tac-Toe",
|
||||
description: "The game of Xs and Os",
|
||||
sku: 11_121_314,
|
||||
unit_price: 3.00
|
||||
},
|
||||
%{
|
||||
name: "Table tennis",
|
||||
description: "Bat the ball bck and forth. Don't miss!",
|
||||
sku: 15_222_324,
|
||||
unit_price: 12.00
|
||||
}
|
||||
]
|
||||
|
||||
Enum.each($3s, fn $3->
|
||||
$2.create_$3($3)
|
||||
end)
|
||||
|
||||
$0
|
||||
@@ -0,0 +1,9 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: alter table migration
|
||||
# key: alter-table
|
||||
# --
|
||||
|
||||
alter table(:$1) do
|
||||
add :$2, :$3
|
||||
$0
|
||||
end
|
||||
@@ -0,0 +1,15 @@
|
||||
# key: simple-form
|
||||
# name: simple form
|
||||
# --
|
||||
<.simple_form>
|
||||
:let={f}
|
||||
for={@$1}
|
||||
id="$2-form"
|
||||
phx-change="validate"
|
||||
phx-submit="save">
|
||||
<.input field={@$1[:$3]} type="$4" label="$5" />
|
||||
$0
|
||||
<:actions>
|
||||
<.button phx-disable-with="$6...">$7</.button>
|
||||
</:actions>
|
||||
</.simple_form>
|
||||
@@ -0,0 +1,15 @@
|
||||
# key: test-module
|
||||
# name: test module
|
||||
# condition: t
|
||||
# --
|
||||
defmodule $1.$2 do
|
||||
import $3
|
||||
use Pento.DataCase
|
||||
|
||||
describe "$3" do
|
||||
test "$4" do
|
||||
$0
|
||||
assert false
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,44 @@
|
||||
# key: thenewtype
|
||||
# name: new purescript newtype in its' own module
|
||||
# --
|
||||
# in 'text-mode' because purescript-mode generates parse error
|
||||
module ${1:ModulePrefix}.${2:NewTypeName} (
|
||||
$2(..)
|
||||
, aDummy
|
||||
) where
|
||||
|
||||
import Data.Firebase.Foreign (class ToFirebaseForeign)
|
||||
import Data.Foreign (toForeign, readString)
|
||||
import Data.Foreign.Class (class IsForeign)
|
||||
import Data.Generic (class Generic, gCompare, gEq, gShow)
|
||||
import Test.QuickCheck.Arbitrary (class Arbitrary, arbitrary)
|
||||
import Prelude (class Eq, class Ord, class Show, ($),bind, pure)
|
||||
import UReview.Prelude (readForeign)
|
||||
|
||||
newtype $2 = $2 {${4:fieldName}:: ${5:Type}}
|
||||
|
||||
aDummy :: $2
|
||||
aDummy = $2 {$4: "$6"}
|
||||
derive instance generic$2 :: Generic $2
|
||||
|
||||
instance show$2 :: Show $2 where
|
||||
show = gShow
|
||||
|
||||
instance eq$2 :: Eq $2 where
|
||||
eq = gEq
|
||||
|
||||
instance ord$2 :: Ord $2 where
|
||||
compare = gCompare
|
||||
|
||||
instance arb$2 :: Arbitrary $2 where
|
||||
arbitrary = do
|
||||
$4 <- arbitrary
|
||||
pure ($2 {$4 })
|
||||
|
||||
instance isForeign$2 :: IsForeign $2 where
|
||||
read fo = readForeign fo
|
||||
|
||||
instance toFirebaseForeign$2 :: ToFirebaseForeign $2
|
||||
where toFire = ${7:conversionFn} >>> toForeign
|
||||
|
||||
$0
|
||||
Reference in New Issue
Block a user