Add 'users/glittershark/emacs.d/' from commit '69ee53bffa
'
git-subtree-dir: users/glittershark/emacs.d git-subtree-mainline:2edb963b97
git-subtree-split:69ee53bffa
This commit is contained in:
commit
4fe4e3d9a2
74 changed files with 5656 additions and 0 deletions
|
@ -0,0 +1,5 @@
|
|||
# key: ann
|
||||
# name: annotation
|
||||
# expand-env: ((yas-indent-line 'fixed))
|
||||
# --
|
||||
{-# ANN ${1:module} ("${2:HLint: ignore ${3:Reduce duplication}}" :: String) #-}
|
|
@ -0,0 +1,26 @@
|
|||
# key: bench
|
||||
# name: benchmark-module
|
||||
# expand-env: ((yas-indent-line (quote fixed)))
|
||||
# --
|
||||
--------------------------------------------------------------------------------
|
||||
module ${1:`(if (not buffer-file-name) "Module"
|
||||
(let ((name (file-name-sans-extension (buffer-file-name)))
|
||||
(case-fold-search nil))
|
||||
(if (cl-search "bench/" name)
|
||||
(replace-regexp-in-string "/" "."
|
||||
(replace-regexp-in-string "^\/[^A-Z]*" ""
|
||||
(car (last (split-string name "src")))))
|
||||
(file-name-nondirectory name))))`} ( benchmark, main ) where
|
||||
--------------------------------------------------------------------------------
|
||||
import Bench.Prelude
|
||||
--------------------------------------------------------------------------------
|
||||
import ${1:$(s-chop-suffix "Bench" yas-text)}
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
main :: IO ()
|
||||
main = defaultMain [benchmark]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
benchmark :: Benchmark
|
||||
benchmark = bgroup "${1:$(->> yas-text (s-chop-suffix "Bench") (s-split ".") -last-item)}" [bench "something dumb" $ nf (1 +) (1 :: Int)]
|
5
users/glittershark/emacs.d/snippets/haskell-mode/header
Normal file
5
users/glittershark/emacs.d/snippets/haskell-mode/header
Normal file
|
@ -0,0 +1,5 @@
|
|||
# key: hh
|
||||
# name: header
|
||||
# expand-env: ((yas-indent-line 'fixed))
|
||||
# --
|
||||
--------------------------------------------------------------------------------$2
|
|
@ -0,0 +1,8 @@
|
|||
# key: gen
|
||||
# name: Hedgehog Generator
|
||||
# expand-env: ((yas-indent-line (quote fixed)))
|
||||
# --
|
||||
gen${1:Foo} :: Gen $1
|
||||
gen$1 = do
|
||||
$2
|
||||
pure $1{..}
|
|
@ -0,0 +1,9 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: Hedgehog Property
|
||||
# key: hprop
|
||||
# expand-env: ((yas-indent-line 'fixed))
|
||||
# --
|
||||
hprop_${1:somethingIsAlwaysTrue} :: Property
|
||||
hprop_$1 = property $ do
|
||||
${2:x} <- forAll ${3:Gen.int $ Range.linear 1 100}
|
||||
${4:x === x}
|
8
users/glittershark/emacs.d/snippets/haskell-mode/hlint
Normal file
8
users/glittershark/emacs.d/snippets/haskell-mode/hlint
Normal file
|
@ -0,0 +1,8 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: hlint
|
||||
# uuid:
|
||||
# expand-env: ((yas-indent-line 'fixed))
|
||||
# key: hlint
|
||||
# condition: t
|
||||
# --
|
||||
{-# ANN module ("Hlint: ignore $1" :: String) #- }
|
|
@ -0,0 +1,4 @@
|
|||
# key: i
|
||||
# name: import-i
|
||||
# --
|
||||
import ${1:Prelude}
|
6
users/glittershark/emacs.d/snippets/haskell-mode/inl
Normal file
6
users/glittershark/emacs.d/snippets/haskell-mode/inl
Normal file
|
@ -0,0 +1,6 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: inl
|
||||
# key: inl
|
||||
# expand-env: ((yas-indent-line 'fixed))
|
||||
# --
|
||||
{-# INLINE $1 #-}
|
5
users/glittershark/emacs.d/snippets/haskell-mode/inline
Normal file
5
users/glittershark/emacs.d/snippets/haskell-mode/inline
Normal file
|
@ -0,0 +1,5 @@
|
|||
# key: inline
|
||||
# name: inline
|
||||
# expand-env: ((yas-indent-line 'fixed))
|
||||
# --
|
||||
{-# INLINE $1 #-}
|
|
@ -0,0 +1,6 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: language pragma
|
||||
# key: lang
|
||||
# expand-env: ((yas-indent-line 'fixed))
|
||||
# --
|
||||
{-# LANGUAGE $1 #-}
|
|
@ -0,0 +1,7 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: lens.field
|
||||
# key: lens
|
||||
# expand-env: ((yas-indent-line 'fixed))
|
||||
# --
|
||||
${1:field} :: Lens' ${2:Source} ${3:Target}
|
||||
$1 = lens _${4:sourceField} $ \\${2:$(-> yas-text s-word-initials s-downcase)} ${4:$(-> yas-text s-word-initials s-downcase)} -> ${2:$(-> yas-text s-word-initials s-downcase)} { _$4 = ${4:$(-> yas-text s-word-initials s-downcase)} }
|
32
users/glittershark/emacs.d/snippets/haskell-mode/module
Normal file
32
users/glittershark/emacs.d/snippets/haskell-mode/module
Normal file
|
@ -0,0 +1,32 @@
|
|||
# -*- mode: snippet -*-
|
||||
# key: module
|
||||
# name: module
|
||||
# condition: (= (length "module") (current-column))
|
||||
# expand-env: ((yas-indent-line 'fixed))
|
||||
# contributor: Luke Hoersten <luke@hoersten.org>
|
||||
# --
|
||||
--------------------------------------------------------------------------------
|
||||
-- |
|
||||
-- Module : $1
|
||||
-- Description : $2
|
||||
-- Maintainer : Griffin Smith <grfn@urbint.com>
|
||||
-- Maturity : ${3:Draft, Usable, Maintained, OR MatureAF}
|
||||
--
|
||||
-- $4
|
||||
--------------------------------------------------------------------------------
|
||||
module ${1:`(if (not buffer-file-name) "Module"
|
||||
(let ((name (file-name-sans-extension (buffer-file-name)))
|
||||
(case-fold-search nil))
|
||||
(if (or (cl-search "src/" name)
|
||||
(cl-search "test/" name))
|
||||
(replace-regexp-in-string "/" "."
|
||||
(replace-regexp-in-string "^\/[^A-Z]*" ""
|
||||
(car (last (split-string name "src")))))
|
||||
(file-name-nondirectory name))))`}
|
||||
(
|
||||
) where
|
||||
--------------------------------------------------------------------------------
|
||||
import Prelude
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
$0
|
|
@ -0,0 +1,6 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: shut up, hlint
|
||||
# key: dupl
|
||||
# expand-env: ((yas-indent-line 'fixed))
|
||||
# --
|
||||
{-# ANN module ("HLint: ignore Reduce duplication" :: String) #-}
|
22
users/glittershark/emacs.d/snippets/haskell-mode/test-module
Normal file
22
users/glittershark/emacs.d/snippets/haskell-mode/test-module
Normal file
|
@ -0,0 +1,22 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: test-module
|
||||
# key: test
|
||||
# expand-env: ((yas-indent-line 'fixed))
|
||||
# --
|
||||
{-# LANGUAGE ApplicativeDo #-}
|
||||
--------------------------------------------------------------------------------
|
||||
module ${1:`(if (not buffer-file-name) "Module"
|
||||
(let ((name (file-name-sans-extension (buffer-file-name)))
|
||||
(case-fold-search nil))
|
||||
(if (cl-search "test/" name)
|
||||
(replace-regexp-in-string "/" "."
|
||||
(replace-regexp-in-string "^\/[^A-Z]*" ""
|
||||
(car (last (split-string name "src")))))
|
||||
(file-name-nondirectory name))))`} where
|
||||
--------------------------------------------------------------------------------
|
||||
import Test.Prelude
|
||||
import qualified Hedgehog.Gen as Gen
|
||||
import qualified Hedgehog.Range as Range
|
||||
--------------------------------------------------------------------------------
|
||||
import ${1:$(s-chop-suffix "Test" yas-text)}
|
||||
--------------------------------------------------------------------------------
|
|
@ -0,0 +1,6 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: undefined
|
||||
# key: u
|
||||
# expand-env: ((yas-indent-line 'fixed) (yas-wrap-around-region 'nil))
|
||||
# --
|
||||
undefined$1
|
4
users/glittershark/emacs.d/snippets/js2-mode/action-type
Normal file
4
users/glittershark/emacs.d/snippets/js2-mode/action-type
Normal file
|
@ -0,0 +1,4 @@
|
|||
# key: at
|
||||
# name: action-type
|
||||
# --
|
||||
export const ${1:FOO_BAR$(->> yas-text s-upcase (s-replace-all '(("-" . "_") (" " . "_"))))}: '${3:ns}/${1:$(-> yas-text s-dashed-words)}' = '$3/${1:$(-> yas-text s-dashed-words)}'$5
|
7
users/glittershark/emacs.d/snippets/js2-mode/before
Normal file
7
users/glittershark/emacs.d/snippets/js2-mode/before
Normal file
|
@ -0,0 +1,7 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: before
|
||||
# key: bef
|
||||
# --
|
||||
before(function() {
|
||||
$1
|
||||
})
|
7
users/glittershark/emacs.d/snippets/js2-mode/context
Normal file
7
users/glittershark/emacs.d/snippets/js2-mode/context
Normal file
|
@ -0,0 +1,7 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: context
|
||||
# key: context
|
||||
# --
|
||||
context('$1', function() {
|
||||
$2
|
||||
})
|
6
users/glittershark/emacs.d/snippets/js2-mode/describe
Normal file
6
users/glittershark/emacs.d/snippets/js2-mode/describe
Normal file
|
@ -0,0 +1,6 @@
|
|||
# key: desc
|
||||
# name: describe
|
||||
# --
|
||||
describe('$1', () => {
|
||||
$2
|
||||
})
|
5
users/glittershark/emacs.d/snippets/js2-mode/expect
Normal file
5
users/glittershark/emacs.d/snippets/js2-mode/expect
Normal file
|
@ -0,0 +1,5 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: expect
|
||||
# key: ex
|
||||
# --
|
||||
expect($1).$2
|
6
users/glittershark/emacs.d/snippets/js2-mode/function
Normal file
6
users/glittershark/emacs.d/snippets/js2-mode/function
Normal file
|
@ -0,0 +1,6 @@
|
|||
# key: f
|
||||
# name: function
|
||||
# --
|
||||
function $1($2) {
|
||||
$3
|
||||
}
|
6
users/glittershark/emacs.d/snippets/js2-mode/header
Normal file
6
users/glittershark/emacs.d/snippets/js2-mode/header
Normal file
|
@ -0,0 +1,6 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: header
|
||||
# key: hh
|
||||
# expand-env: ((yas-indent-line 'fixed))
|
||||
# --
|
||||
////////////////////////////////////////////////////////////////////////////////
|
7
users/glittershark/emacs.d/snippets/js2-mode/it
Normal file
7
users/glittershark/emacs.d/snippets/js2-mode/it
Normal file
|
@ -0,0 +1,7 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: it
|
||||
# key: it
|
||||
# --
|
||||
it('$1', () => {
|
||||
$2
|
||||
})
|
5
users/glittershark/emacs.d/snippets/js2-mode/it-pending
Normal file
5
users/glittershark/emacs.d/snippets/js2-mode/it-pending
Normal file
|
@ -0,0 +1,5 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: it-pending
|
||||
# key: xi
|
||||
# --
|
||||
it('$1')$0
|
12
users/glittershark/emacs.d/snippets/js2-mode/module
Normal file
12
users/glittershark/emacs.d/snippets/js2-mode/module
Normal file
|
@ -0,0 +1,12 @@
|
|||
# key: module
|
||||
# name: module
|
||||
# expand-env: ((yas-indent-line (quote fixed)))
|
||||
# condition: (= (length "module") (current-column))
|
||||
# --
|
||||
/**
|
||||
* @fileOverview $1
|
||||
* @name ${2:`(file-name-nondirectory (buffer-file-name))`}
|
||||
* @author Griffin Smith
|
||||
* @license Proprietary
|
||||
*/
|
||||
$3
|
7
users/glittershark/emacs.d/snippets/js2-mode/record
Normal file
7
users/glittershark/emacs.d/snippets/js2-mode/record
Normal file
|
@ -0,0 +1,7 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: record
|
||||
# key: rec
|
||||
# --
|
||||
export default class $1 extends Record({
|
||||
$2
|
||||
}) {}
|
7
users/glittershark/emacs.d/snippets/js2-mode/test
Normal file
7
users/glittershark/emacs.d/snippets/js2-mode/test
Normal file
|
@ -0,0 +1,7 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: test
|
||||
# key: test
|
||||
# --
|
||||
test('$1', () => {
|
||||
$2
|
||||
})
|
12
users/glittershark/emacs.d/snippets/nix-mode/fetchFromGitHub
Normal file
12
users/glittershark/emacs.d/snippets/nix-mode/fetchFromGitHub
Normal file
|
@ -0,0 +1,12 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: fetchFromGitHub
|
||||
# uuid:
|
||||
# key: fetchFromGitHub
|
||||
# condition: t
|
||||
# --
|
||||
fetchFromGitHub {
|
||||
owner = "$1";
|
||||
repo = "$2";
|
||||
rev = "$3";
|
||||
sha256 = "0000000000000000000000000000000000000000000000000000";
|
||||
}
|
16
users/glittershark/emacs.d/snippets/nix-mode/pythonPackage
Normal file
16
users/glittershark/emacs.d/snippets/nix-mode/pythonPackage
Normal file
|
@ -0,0 +1,16 @@
|
|||
# key: pypkg
|
||||
# name: pythonPackage
|
||||
# condition: t
|
||||
# --
|
||||
${1:pname} = buildPythonPackage rec {
|
||||
name = "\${pname}-\${version}";
|
||||
pname = "$1";
|
||||
version = "${2:1.0.0}";
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "0000000000000000000000000000000000000000000000000000";
|
||||
};
|
||||
propagatedBuildInputs = with pythonSelf; [
|
||||
$3
|
||||
];
|
||||
};
|
7
users/glittershark/emacs.d/snippets/nix-mode/sha256
Normal file
7
users/glittershark/emacs.d/snippets/nix-mode/sha256
Normal file
|
@ -0,0 +1,7 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: sha256
|
||||
# uuid:
|
||||
# key: sha256
|
||||
# condition: t
|
||||
# --
|
||||
sha256 = "0000000000000000000000000000000000000000000000000000";
|
|
@ -0,0 +1,6 @@
|
|||
# key: sql
|
||||
# name: SQL source block
|
||||
# --
|
||||
#+BEGIN_SRC sql ${1::async}
|
||||
$2
|
||||
#+END_SRC
|
13
users/glittershark/emacs.d/snippets/org-mode/combat
Normal file
13
users/glittershark/emacs.d/snippets/org-mode/combat
Normal file
|
@ -0,0 +1,13 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: combat
|
||||
# uuid:
|
||||
# key: combat
|
||||
# condition: t
|
||||
# --
|
||||
| | initiative | max hp | current hp | status | |
|
||||
|-------------+------------+--------+------------+--------+------|
|
||||
| Barty Barty | | | | | <--- |
|
||||
| Hectoroth | | | | | |
|
||||
| Xanadu | | | | | |
|
||||
| Aurora | | | | | |
|
||||
| EFB | | | | | |
|
5
users/glittershark/emacs.d/snippets/org-mode/date
Normal file
5
users/glittershark/emacs.d/snippets/org-mode/date
Normal file
|
@ -0,0 +1,5 @@
|
|||
# -*- mode: snippet -*-
|
||||
# key: date
|
||||
# name: date.org
|
||||
# --
|
||||
[`(format-time-string "%Y-%m-%d")`]$0
|
5
users/glittershark/emacs.d/snippets/org-mode/date-time
Normal file
5
users/glittershark/emacs.d/snippets/org-mode/date-time
Normal file
|
@ -0,0 +1,5 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: date-time
|
||||
# key: dt
|
||||
# --
|
||||
[`(format-time-string "%Y-%m-%d %H:%m:%S")`]
|
7
users/glittershark/emacs.d/snippets/org-mode/description
Normal file
7
users/glittershark/emacs.d/snippets/org-mode/description
Normal file
|
@ -0,0 +1,7 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: description
|
||||
# key: desc
|
||||
# --
|
||||
:DESCRIPTION:
|
||||
$1
|
||||
:END:
|
5
users/glittershark/emacs.d/snippets/org-mode/nologdone
Normal file
5
users/glittershark/emacs.d/snippets/org-mode/nologdone
Normal file
|
@ -0,0 +1,5 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: nologdone
|
||||
# key: nologdone
|
||||
# --
|
||||
#+STARTUP: nologdone$0
|
|
@ -0,0 +1,6 @@
|
|||
# key: py
|
||||
# name: Python source block
|
||||
# --
|
||||
#+BEGIN_SRC python
|
||||
$0
|
||||
#+END_SRC
|
6
users/glittershark/emacs.d/snippets/org-mode/reveal
Normal file
6
users/glittershark/emacs.d/snippets/org-mode/reveal
Normal file
|
@ -0,0 +1,6 @@
|
|||
# key: reveal
|
||||
# name: reveal
|
||||
# condition: t
|
||||
# --
|
||||
#+ATTR_REVEAL: :frag ${1:roll-in}
|
||||
$0
|
7
users/glittershark/emacs.d/snippets/org-mode/transaction
Normal file
7
users/glittershark/emacs.d/snippets/org-mode/transaction
Normal file
|
@ -0,0 +1,7 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: transaction
|
||||
# key: begin
|
||||
# --
|
||||
BEGIN;
|
||||
$0
|
||||
ROLLBACK;
|
|
@ -0,0 +1,5 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: add_column
|
||||
# key: op.add_column
|
||||
# --
|
||||
op.add_column('${1:table}', sa.Column('${2:name}', sa.${3:String()}))$0
|
15
users/glittershark/emacs.d/snippets/python-mode/decorate
Normal file
15
users/glittershark/emacs.d/snippets/python-mode/decorate
Normal file
|
@ -0,0 +1,15 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: decorate
|
||||
# uuid:
|
||||
# key: decorate
|
||||
# condition: t
|
||||
# --
|
||||
def wrap(inner):
|
||||
@wraps(inner)
|
||||
def wrapped(*args, **kwargs):
|
||||
ret = inner(*args, **kwargs)
|
||||
return ret
|
||||
|
||||
return wrapped
|
||||
|
||||
return wrap
|
7
users/glittershark/emacs.d/snippets/python-mode/dunder
Normal file
7
users/glittershark/emacs.d/snippets/python-mode/dunder
Normal file
|
@ -0,0 +1,7 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: dunder
|
||||
# uuid:
|
||||
# key: du
|
||||
# condition: t
|
||||
# --
|
||||
__$1__$0
|
7
users/glittershark/emacs.d/snippets/python-mode/name
Normal file
7
users/glittershark/emacs.d/snippets/python-mode/name
Normal file
|
@ -0,0 +1,7 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: name
|
||||
# uuid:
|
||||
# key: name
|
||||
# condition: t
|
||||
# --
|
||||
__name__
|
|
@ -0,0 +1,7 @@
|
|||
# key: exec
|
||||
# name: op.get_bind.execute
|
||||
# --
|
||||
op.get_bind().execute(
|
||||
"""
|
||||
`(progn (sqlup-mode) "")`$1
|
||||
""")
|
7
users/glittershark/emacs.d/snippets/python-mode/pdb
Normal file
7
users/glittershark/emacs.d/snippets/python-mode/pdb
Normal file
|
@ -0,0 +1,7 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: pdb
|
||||
# uuid:
|
||||
# key: pdb
|
||||
# condition: t
|
||||
# --
|
||||
import pdb; pdb.set_trace()
|
|
@ -0,0 +1,5 @@
|
|||
# key: macro_use
|
||||
# name: #[macro_use]
|
||||
# --
|
||||
#[macro_use]
|
||||
${1:extern crate} ${2:something};$0
|
9
users/glittershark/emacs.d/snippets/rust-mode/tests
Normal file
9
users/glittershark/emacs.d/snippets/rust-mode/tests
Normal file
|
@ -0,0 +1,9 @@
|
|||
# key: tests
|
||||
# name: test module
|
||||
# --
|
||||
#[cfg(test)]
|
||||
mod ${1:tests} {
|
||||
use super::*;
|
||||
|
||||
$0
|
||||
}
|
5
users/glittershark/emacs.d/snippets/snippet-mode/indent
Normal file
5
users/glittershark/emacs.d/snippets/snippet-mode/indent
Normal file
|
@ -0,0 +1,5 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: indent
|
||||
# key: indent
|
||||
# --
|
||||
# expand-env: ((yas-indent-line 'fixed))
|
|
@ -0,0 +1,5 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: count(*) group by
|
||||
# key: countby
|
||||
# --
|
||||
SELECT count(*), ${1:column} FROM ${2:table} GROUP BY $1;
|
5
users/glittershark/emacs.d/snippets/text-mode/date
Normal file
5
users/glittershark/emacs.d/snippets/text-mode/date
Normal file
|
@ -0,0 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# name: date
|
||||
# key: date
|
||||
# --
|
||||
`(format-time-string "%Y-%m-%d")`$0
|
Loading…
Add table
Add a link
Reference in a new issue