Compare commits
3 Commits
2d510d289c
...
88f17ff438
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
88f17ff438 | ||
|
|
5948c1256a | ||
|
|
db4f52a064 |
@@ -166,6 +166,9 @@ source "$OSH"/oh-my-bash.sh
|
||||
# users are encouraged to define aliases within the OSH_CUSTOM folder.
|
||||
# For a full list of active aliases, run `
|
||||
|
||||
# export EDITOR="emacs -nw"
|
||||
# export VISUAL="emacs"
|
||||
|
||||
alias ls='ls --color=auto --group-directories-first'
|
||||
|
||||
# Replace grep command tool
|
||||
|
||||
@@ -45,6 +45,9 @@
|
||||
'lang/c
|
||||
'lang/docker
|
||||
'lang/golang
|
||||
'lang/json
|
||||
'lang/markdown
|
||||
'lang/org
|
||||
'lang/shell
|
||||
'lang/yaml
|
||||
|
||||
|
||||
@@ -50,9 +50,6 @@
|
||||
;; Enable line numbers in the configuration mode only
|
||||
(add-hook 'conf-mode-hook 'display-line-numbers-mode)
|
||||
|
||||
;; Setting default directory for Org files
|
||||
(setq org-directory "~/Remotes/pCloud/Org")
|
||||
|
||||
;; Highlight keywords to remember the activity when coding.
|
||||
(use-package hl-todo
|
||||
:ensure t
|
||||
|
||||
7
emacs/.emacs.d/lisp/lang/json.el
Normal file
7
emacs/.emacs.d/lisp/lang/json.el
Normal file
@@ -0,0 +1,7 @@
|
||||
;;; json.el -*- lexical-binding: t -*-
|
||||
(use-package json-mode
|
||||
:ensure t)
|
||||
|
||||
(provide 'json)
|
||||
|
||||
;;; json.el ends here
|
||||
8
emacs/.emacs.d/lisp/lang/markdown.el
Normal file
8
emacs/.emacs.d/lisp/lang/markdown.el
Normal file
@@ -0,0 +1,8 @@
|
||||
;;; markdown.el -*- lexical-binding: t; -*-
|
||||
(use-package markdown-mode
|
||||
:ensure t
|
||||
:mode ("README\\.md\\'" . gfm-mode)
|
||||
:init (setq markdown-command "multimarkdown"))
|
||||
|
||||
(provide 'markdown)
|
||||
;;; markdown.el ends here
|
||||
46
emacs/.emacs.d/lisp/lang/org.el
Normal file
46
emacs/.emacs.d/lisp/lang/org.el
Normal file
@@ -0,0 +1,46 @@
|
||||
;;; org.el -*- lexical-binding: t; -*-
|
||||
|
||||
(use-package htmlize
|
||||
:ensure t)
|
||||
|
||||
(use-package org
|
||||
:init
|
||||
(setq org-clock-mode-line-total 'today
|
||||
org-fontify-quote-and-verse-blocks t
|
||||
org-indent-mode t
|
||||
org-return-follows-link t
|
||||
org-startup-folded 'content
|
||||
org-todo-keywords '((sequence "🆕(t)" "▶️(s)" "⏳(w)" "🔎(p)" "|" "✅(d)" "🗑(c)" "👨(g)")))
|
||||
:config
|
||||
(add-hook 'org-mode-hook 'org-indent-mode)
|
||||
(add-hook 'org-mode-hook 'flyspell-mode))
|
||||
|
||||
(use-package org-bullets
|
||||
:ensure t
|
||||
:init
|
||||
(setq org-bullets-bullet-list '("❯" "❯❯" "❯❯❯" "❯❯❯❯" "❯❯❯❯❯"))
|
||||
:config
|
||||
(add-hook 'org-mode-hook 'org-bullets-mode))
|
||||
|
||||
(use-package org-re-reveal
|
||||
:ensure t
|
||||
:init
|
||||
(setq org-re-reveal-transition 'none
|
||||
org-re-reveal-theme "dracula"))
|
||||
|
||||
(use-package ob-mermaid
|
||||
:ensure t
|
||||
:init
|
||||
(setq ob-mermaid-cli-path "mmdc")
|
||||
(org-babel-do-load-languages
|
||||
'org-babel-load-languages
|
||||
'((mermaid . t)
|
||||
(scheme . t))))
|
||||
|
||||
|
||||
;; Setting default directory for Org files
|
||||
(setq org-directory "~/Remotes/pCloud/Org")
|
||||
|
||||
(provide 'org)
|
||||
|
||||
;;; org.el ends here
|
||||
@@ -27,6 +27,14 @@
|
||||
:config
|
||||
(setq flycheck-check-syntax-automatically '(save mode-enabled)))
|
||||
|
||||
;; Snippets
|
||||
(use-package yasnippet
|
||||
:ensure t
|
||||
:config
|
||||
(setq yas/root-directory
|
||||
(list "~/.emacs.d/snippets") yas-indent-line 'fixed)
|
||||
(yas-global-mode))
|
||||
|
||||
(provide 'completion)
|
||||
|
||||
;;; completion.el ends here
|
||||
|
||||
3
emacs/.emacs.d/snippets/go-mode/main
Normal file
3
emacs/.emacs.d/snippets/go-mode/main
Normal file
@@ -0,0 +1,3 @@
|
||||
func main() {
|
||||
$0
|
||||
}
|
||||
1
emacs/.emacs.d/snippets/go-mode/pr
Normal file
1
emacs/.emacs.d/snippets/go-mode/pr
Normal file
@@ -0,0 +1 @@
|
||||
fmt.Printf("%v\n", $0)
|
||||
23
emacs/.emacs.d/snippets/go-mode/tt
Normal file
23
emacs/.emacs.d/snippets/go-mode/tt
Normal file
@@ -0,0 +1,23 @@
|
||||
func Test$0 {
|
||||
tests := []struct {
|
||||
name string
|
||||
req string
|
||||
expected string
|
||||
}{
|
||||
{
|
||||
name: "happy path",
|
||||
req: "answer to life, the universe and everything"
|
||||
expected: "42"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
actual := foo(t, tt.req)
|
||||
assertEquals(t, tt.want, expected)
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
3
emacs/.emacs.d/snippets/java-mode/author
Normal file
3
emacs/.emacs.d/snippets/java-mode/author
Normal file
@@ -0,0 +1,3 @@
|
||||
#name : author
|
||||
# --
|
||||
@author <a href="mailto:torstein@skybert.net">Torstein Krause Johansen</a>$0
|
||||
6
emacs/.emacs.d/snippets/java-mode/debug
Normal file
6
emacs/.emacs.d/snippets/java-mode/debug
Normal file
@@ -0,0 +1,6 @@
|
||||
#name : debug
|
||||
# --
|
||||
if (mLogger.isDebugEnabled()) {
|
||||
mLogger.debug(String.format("${1:result}=%s", ${2:result}));
|
||||
}
|
||||
$0
|
||||
31
emacs/.emacs.d/snippets/java-mode/dwmain
Normal file
31
emacs/.emacs.d/snippets/java-mode/dwmain
Normal file
@@ -0,0 +1,31 @@
|
||||
#name : dwmain
|
||||
# --
|
||||
package ${1:net.skybert.dw};
|
||||
|
||||
import io.dropwizard.Application;
|
||||
import io.dropwizard.assets.AssetsBundle;
|
||||
import io.dropwizard.configuration.SubstitutingSourceProvider;
|
||||
import io.dropwizard.jetty.ConnectorFactory;
|
||||
import io.dropwizard.jetty.HttpConnectorFactory;
|
||||
import io.dropwizard.lifecycle.Managed;
|
||||
import io.dropwizard.server.DefaultServerFactory;
|
||||
import io.dropwizard.setup.Bootstrap;
|
||||
import io.dropwizard.setup.Environment;
|
||||
|
||||
/**
|
||||
* Main
|
||||
*/
|
||||
public class Main extends Application<${2:SkybertConf}> {
|
||||
|
||||
public static void main(final String[] args) throws Exception {
|
||||
new Main().run(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(
|
||||
final $2 pConfiguration,
|
||||
final Environment pEnvironment)
|
||||
throws Exception {
|
||||
$0
|
||||
}
|
||||
}
|
||||
5
emacs/.emacs.d/snippets/java-mode/fn
Normal file
5
emacs/.emacs.d/snippets/java-mode/fn
Normal file
@@ -0,0 +1,5 @@
|
||||
#name : new method/function
|
||||
# --
|
||||
${1:public} ${2:void} ${3:update}(final ${4:String} ${5:pName}) {
|
||||
$0
|
||||
}
|
||||
5
emacs/.emacs.d/snippets/java-mode/for
Normal file
5
emacs/.emacs.d/snippets/java-mode/for
Normal file
@@ -0,0 +1,5 @@
|
||||
#name : for (...; ...; ...) { ... }
|
||||
# --
|
||||
for (${1:Object} ${downcase-word 1} ; ${2:list}) {
|
||||
$0
|
||||
}
|
||||
5
emacs/.emacs.d/snippets/java-mode/fori
Normal file
5
emacs/.emacs.d/snippets/java-mode/fori
Normal file
@@ -0,0 +1,5 @@
|
||||
#name : for loop with index
|
||||
# --
|
||||
for (int ${1:i} = 0; $1 < ${2:args.length}; $1${3:++}) {
|
||||
$0
|
||||
}
|
||||
13
emacs/.emacs.d/snippets/java-mode/gse
Normal file
13
emacs/.emacs.d/snippets/java-mode/gse
Normal file
@@ -0,0 +1,13 @@
|
||||
#name : get/set/member variable
|
||||
# --
|
||||
private ${1:String} ${2:name};
|
||||
|
||||
public void set${2:$(capitalize text)}(final $1 p${2:$(capitalize text)}) {
|
||||
$2 = p${2:$(capitalize text)};
|
||||
}
|
||||
|
||||
public $1 get${2:$(capitalize text)}() {
|
||||
return $2;
|
||||
}
|
||||
$0
|
||||
|
||||
6
emacs/.emacs.d/snippets/java-mode/if
Normal file
6
emacs/.emacs.d/snippets/java-mode/if
Normal file
@@ -0,0 +1,6 @@
|
||||
#name : if
|
||||
# --
|
||||
if (${1:result} ${2:!=} ${3:null}) {
|
||||
$0
|
||||
}
|
||||
|
||||
4
emacs/.emacs.d/snippets/java-mode/iisblank
Normal file
4
emacs/.emacs.d/snippets/java-mode/iisblank
Normal file
@@ -0,0 +1,4 @@
|
||||
#name : static import of isBlank
|
||||
# --
|
||||
import static org.apache.commons.lang.StringUtils.isBlank;
|
||||
$0
|
||||
21
emacs/.emacs.d/snippets/java-mode/junitwrapperfns
Normal file
21
emacs/.emacs.d/snippets/java-mode/junitwrapperfns
Normal file
@@ -0,0 +1,21 @@
|
||||
#name : junitwrapperfns
|
||||
# --
|
||||
private void assertTrue(final String pMessage, final boolean pConditition) {
|
||||
Assertions.assertTrue(pConditition, pMessage);
|
||||
}
|
||||
|
||||
private void assertFalse(final String pMessage, final boolean pConditition) {
|
||||
Assertions.assertFalse(pConditition, pMessage);
|
||||
}
|
||||
|
||||
private void assertNotNull(final String pMessage, final Object pActual) {
|
||||
Assertions.assertNotNull(pActual, pMessage);
|
||||
}
|
||||
|
||||
private void assertNull(final String pMessage, final Object pActual) {
|
||||
Assertions.assertNull(pActual, pMessage);
|
||||
}
|
||||
|
||||
private void assertEquals(final String pMessage, final Object pExpected, final Object pActual) {
|
||||
Assertions.assertEquals(pExpected, pActual, pMessage);
|
||||
}
|
||||
5
emacs/.emacs.d/snippets/java-mode/main
Normal file
5
emacs/.emacs.d/snippets/java-mode/main
Normal file
@@ -0,0 +1,5 @@
|
||||
#name : main
|
||||
# --
|
||||
public static void main(String[] args) {
|
||||
$0
|
||||
}
|
||||
3
emacs/.emacs.d/snippets/java-mode/np
Normal file
3
emacs/.emacs.d/snippets/java-mode/np
Normal file
@@ -0,0 +1,3 @@
|
||||
#name : np
|
||||
# --
|
||||
// NOPMD
|
||||
3
emacs/.emacs.d/snippets/java-mode/ol
Normal file
3
emacs/.emacs.d/snippets/java-mode/ol
Normal file
@@ -0,0 +1,3 @@
|
||||
#name : get ObjectLoader
|
||||
# --
|
||||
$0ObjectLoader objectLoader = IOAPI.getAPI().getObjectLoader();
|
||||
6
emacs/.emacs.d/snippets/java-mode/req
Normal file
6
emacs/.emacs.d/snippets/java-mode/req
Normal file
@@ -0,0 +1,6 @@
|
||||
#name : req
|
||||
# --
|
||||
HttpRequest request = HttpRequest.newBuilder()
|
||||
.uri(URI.create($0))
|
||||
.timeout(Duration.ofMillis(getResponseTimeout()))
|
||||
.build();
|
||||
3
emacs/.emacs.d/snippets/java-mode/res
Normal file
3
emacs/.emacs.d/snippets/java-mode/res
Normal file
@@ -0,0 +1,3 @@
|
||||
#name : res
|
||||
# --
|
||||
HttpResponse<String> response = mHttpClient.send(request, ofString());$0
|
||||
3
emacs/.emacs.d/snippets/java-mode/sf
Normal file
3
emacs/.emacs.d/snippets/java-mode/sf
Normal file
@@ -0,0 +1,3 @@
|
||||
#name : sf
|
||||
# --
|
||||
String.format("%s", $0)
|
||||
3
emacs/.emacs.d/snippets/java-mode/sop
Normal file
3
emacs/.emacs.d/snippets/java-mode/sop
Normal file
@@ -0,0 +1,3 @@
|
||||
#name : System.out.println
|
||||
# --
|
||||
System.out.println($0);
|
||||
4
emacs/.emacs.d/snippets/java-mode/test
Normal file
4
emacs/.emacs.d/snippets/java-mode/test
Normal file
@@ -0,0 +1,4 @@
|
||||
@Test
|
||||
void ${1:can}() throws Exception {
|
||||
$0
|
||||
}
|
||||
12
emacs/.emacs.d/snippets/java-mode/tryf
Normal file
12
emacs/.emacs.d/snippets/java-mode/tryf
Normal file
@@ -0,0 +1,12 @@
|
||||
#name : try, catch & finally
|
||||
# --
|
||||
try {
|
||||
$0
|
||||
}
|
||||
catch (${1:Exception} ${2:e}) {
|
||||
mLogger.error($2);
|
||||
}
|
||||
finally {
|
||||
|
||||
}
|
||||
|
||||
8
emacs/.emacs.d/snippets/java-mode/tyc
Normal file
8
emacs/.emacs.d/snippets/java-mode/tyc
Normal file
@@ -0,0 +1,8 @@
|
||||
#name : try & catch
|
||||
# --
|
||||
try {
|
||||
$0
|
||||
}
|
||||
catch (${1:Exception} ${2:e}) {
|
||||
mLogger.error($2);
|
||||
}
|
||||
4
emacs/.emacs.d/snippets/js2-mode/a
Normal file
4
emacs/.emacs.d/snippets/js2-mode/a
Normal file
@@ -0,0 +1,4 @@
|
||||
#name : new array
|
||||
# --
|
||||
var ${1:myArray} = new Array();
|
||||
$0
|
||||
6
emacs/.emacs.d/snippets/js2-mode/fn
Normal file
6
emacs/.emacs.d/snippets/js2-mode/fn
Normal file
@@ -0,0 +1,6 @@
|
||||
#name : function
|
||||
# --
|
||||
function ${1:test}(${2:pValue}) {
|
||||
$0
|
||||
}
|
||||
|
||||
5
emacs/.emacs.d/snippets/js2-mode/for
Normal file
5
emacs/.emacs.d/snippets/js2-mode/for
Normal file
@@ -0,0 +1,5 @@
|
||||
#name : for (...; ...; ...) { ... }
|
||||
# --
|
||||
for (var ${1:i} = 0; $1 < ${2:args.length}; $1${3:++}) {
|
||||
$0
|
||||
}
|
||||
6
emacs/.emacs.d/snippets/js2-mode/if
Normal file
6
emacs/.emacs.d/snippets/js2-mode/if
Normal file
@@ -0,0 +1,6 @@
|
||||
#name : if
|
||||
# --
|
||||
if (${1:s} == ${2:undefined}) {
|
||||
$0
|
||||
}
|
||||
|
||||
3
emacs/.emacs.d/snippets/js2-mode/log
Normal file
3
emacs/.emacs.d/snippets/js2-mode/log
Normal file
@@ -0,0 +1,3 @@
|
||||
#name : log
|
||||
# --
|
||||
console.log("$0");
|
||||
3
emacs/.emacs.d/snippets/markdown-mode/a
Normal file
3
emacs/.emacs.d/snippets/markdown-mode/a
Normal file
@@ -0,0 +1,3 @@
|
||||
#name : a
|
||||
# --
|
||||
[${1}](${2})${0}
|
||||
9
emacs/.emacs.d/snippets/markdown-mode/img
Normal file
9
emacs/.emacs.d/snippets/markdown-mode/img
Normal file
@@ -0,0 +1,9 @@
|
||||
#name : img snippet
|
||||
# --
|
||||
|
||||
<img
|
||||
class="centered"
|
||||
src="${1:foo.png}"
|
||||
alt="${2:alt img text}"
|
||||
/>
|
||||
$0
|
||||
3
emacs/.emacs.d/snippets/markdown-mode/me
Normal file
3
emacs/.emacs.d/snippets/markdown-mode/me
Normal file
@@ -0,0 +1,3 @@
|
||||
# name : me
|
||||
# --
|
||||
[@skybert](https://skybert.net) ${1:says:}$0
|
||||
17
emacs/.emacs.d/snippets/markdown-mode/pa
Normal file
17
emacs/.emacs.d/snippets/markdown-mode/pa
Normal file
@@ -0,0 +1,17 @@
|
||||
#name : pelican article
|
||||
# --
|
||||
title: ${1:`(s-replace "-" " " (file-name-base (buffer-file-name)))`}
|
||||
date: ${2:`(format-time-string "%Y-%m-%d" (current-time))`}
|
||||
category: ${3:`(file-name-nondirectory
|
||||
(substring
|
||||
(file-name-directory (buffer-file-name))
|
||||
0
|
||||
(- (length (file-name-directory (buffer-file-name))) 1)
|
||||
))`}
|
||||
tags: ${4:`(file-name-nondirectory
|
||||
(substring
|
||||
(file-name-directory (buffer-file-name))
|
||||
0
|
||||
(- (length (file-name-directory (buffer-file-name))) 1)
|
||||
))`}
|
||||
$0
|
||||
6
emacs/.emacs.d/snippets/markdown-mode/src
Normal file
6
emacs/.emacs.d/snippets/markdown-mode/src
Normal file
@@ -0,0 +1,6 @@
|
||||
#name : src code snippet
|
||||
# --
|
||||
|
||||
\`\`\`${1:text}
|
||||
$0
|
||||
\`\`\`
|
||||
4
emacs/.emacs.d/snippets/markdown-mode/st
Normal file
4
emacs/.emacs.d/snippets/markdown-mode/st
Normal file
@@ -0,0 +1,4 @@
|
||||
#name : strong element
|
||||
# --
|
||||
|
||||
<strong>${1:text}</strong>$0
|
||||
3
emacs/.emacs.d/snippets/nxml-mode/cdata
Normal file
3
emacs/.emacs.d/snippets/nxml-mode/cdata
Normal file
@@ -0,0 +1,3 @@
|
||||
#name: cdata
|
||||
# --
|
||||
<![CDATA[$0]]>
|
||||
8
emacs/.emacs.d/snippets/nxml-mode/cha
Normal file
8
emacs/.emacs.d/snippets/nxml-mode/cha
Normal file
@@ -0,0 +1,8 @@
|
||||
#name : cha
|
||||
# --
|
||||
<chapter xml:id="t_${1:$(replace-regexp-in-string " " "_" (downcase text))}">
|
||||
<title>${1:My Title}</title>
|
||||
<para>
|
||||
$0
|
||||
</para>
|
||||
</chapter>
|
||||
7
emacs/.emacs.d/snippets/nxml-mode/dep
Normal file
7
emacs/.emacs.d/snippets/nxml-mode/dep
Normal file
@@ -0,0 +1,7 @@
|
||||
#name : dep
|
||||
# --
|
||||
<dependency>
|
||||
<groupId>$1</groupId>
|
||||
<artifactId>$2</artifactId>
|
||||
<version>$0</version>
|
||||
</dependency>
|
||||
10
emacs/.emacs.d/snippets/nxml-mode/diary
Normal file
10
emacs/.emacs.d/snippets/nxml-mode/diary
Normal file
@@ -0,0 +1,10 @@
|
||||
#name : diary
|
||||
# --
|
||||
<!--#include virtual="/ssi/header.shtml" -->
|
||||
<h1>$1</h1>
|
||||
<div id="main">
|
||||
<p>
|
||||
$0
|
||||
</p>
|
||||
</div>
|
||||
<!--#include virtual="/ssi/footer.shtml" -->
|
||||
6
emacs/.emacs.d/snippets/nxml-mode/exclusion
Executable file
6
emacs/.emacs.d/snippets/nxml-mode/exclusion
Executable file
@@ -0,0 +1,6 @@
|
||||
#name : exclusion
|
||||
# --
|
||||
<exclusion>
|
||||
<groupId>$1</groupId>
|
||||
<artifactId>$2</artifactId>
|
||||
</exclusion>$0
|
||||
8
emacs/.emacs.d/snippets/nxml-mode/exclusions
Normal file
8
emacs/.emacs.d/snippets/nxml-mode/exclusions
Normal file
@@ -0,0 +1,8 @@
|
||||
#name : exclusions
|
||||
# --
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>$1</groupId>
|
||||
<artifactId>$2</artifactId>
|
||||
</exclusion>$0
|
||||
</exclusions>
|
||||
3
emacs/.emacs.d/snippets/nxml-mode/incvar
Normal file
3
emacs/.emacs.d/snippets/nxml-mode/incvar
Normal file
@@ -0,0 +1,3 @@
|
||||
#name : incvar
|
||||
# --
|
||||
<xi:include href="local-variables.ebk" xpointer="${1:l-product-um}"/>$0
|
||||
10
emacs/.emacs.d/snippets/nxml-mode/list
Normal file
10
emacs/.emacs.d/snippets/nxml-mode/list
Normal file
@@ -0,0 +1,10 @@
|
||||
#name : list
|
||||
# --
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
$0
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
4
emacs/.emacs.d/snippets/nxml-mode/listi
Normal file
4
emacs/.emacs.d/snippets/nxml-mode/listi
Normal file
@@ -0,0 +1,4 @@
|
||||
#name : listi
|
||||
# --
|
||||
<listitem><para>$0</para></listitem>
|
||||
|
||||
3
emacs/.emacs.d/snippets/nxml-mode/lit
Normal file
3
emacs/.emacs.d/snippets/nxml-mode/lit
Normal file
@@ -0,0 +1,3 @@
|
||||
#name : lit
|
||||
# --
|
||||
<literal>$0</literal>
|
||||
5
emacs/.emacs.d/snippets/nxml-mode/oli
Normal file
5
emacs/.emacs.d/snippets/nxml-mode/oli
Normal file
@@ -0,0 +1,5 @@
|
||||
#name : ol with a li
|
||||
# --
|
||||
<ol>
|
||||
<li>$0</li>
|
||||
</ol>
|
||||
5
emacs/.emacs.d/snippets/nxml-mode/para
Normal file
5
emacs/.emacs.d/snippets/nxml-mode/para
Normal file
@@ -0,0 +1,5 @@
|
||||
#name : para
|
||||
# --
|
||||
<para>
|
||||
$0
|
||||
</para>
|
||||
4
emacs/.emacs.d/snippets/nxml-mode/prog
Normal file
4
emacs/.emacs.d/snippets/nxml-mode/prog
Normal file
@@ -0,0 +1,4 @@
|
||||
#name : prog
|
||||
# --
|
||||
<programlisting><![CDATA[$0
|
||||
]]></programlisting>
|
||||
5
emacs/.emacs.d/snippets/nxml-mode/scr
Normal file
5
emacs/.emacs.d/snippets/nxml-mode/scr
Normal file
@@ -0,0 +1,5 @@
|
||||
#name : insert a JS tag without src
|
||||
# --
|
||||
<script type="text/javascript">
|
||||
$0
|
||||
</script>
|
||||
4
emacs/.emacs.d/snippets/nxml-mode/scri
Normal file
4
emacs/.emacs.d/snippets/nxml-mode/scri
Normal file
@@ -0,0 +1,4 @@
|
||||
#name : insert a JS tag with src
|
||||
# --
|
||||
<script type="text/javascript" src="${1:script.js}"></script>
|
||||
$0
|
||||
8
emacs/.emacs.d/snippets/nxml-mode/sec
Normal file
8
emacs/.emacs.d/snippets/nxml-mode/sec
Normal file
@@ -0,0 +1,8 @@
|
||||
#name : sec
|
||||
# --
|
||||
<section xml:id="t_${1:$(replace-regexp-in-string " " "_" (downcase text))}">
|
||||
<title>${1:My Title}</title>
|
||||
<para>
|
||||
$0
|
||||
</para>
|
||||
</section>
|
||||
5
emacs/.emacs.d/snippets/nxml-mode/uli
Normal file
5
emacs/.emacs.d/snippets/nxml-mode/uli
Normal file
@@ -0,0 +1,5 @@
|
||||
#name : ul with a li
|
||||
# --
|
||||
<ul>
|
||||
<li>$0</li>
|
||||
</ul>
|
||||
3
emacs/.emacs.d/snippets/nxml-mode/varece
Normal file
3
emacs/.emacs.d/snippets/nxml-mode/varece
Normal file
@@ -0,0 +1,3 @@
|
||||
#name : varece
|
||||
# --
|
||||
<xi:include href="ece-global:global-variables.ebk" xpointer="g-engine" />
|
||||
4
emacs/.emacs.d/snippets/nxml-mode/xlink
Normal file
4
emacs/.emacs.d/snippets/nxml-mode/xlink
Normal file
@@ -0,0 +1,4 @@
|
||||
#name : xlink
|
||||
# --
|
||||
<link xlink:href="${1:https://example.com}">$2</link>
|
||||
$0
|
||||
5
emacs/.emacs.d/snippets/org-mode/code
Normal file
5
emacs/.emacs.d/snippets/org-mode/code
Normal file
@@ -0,0 +1,5 @@
|
||||
#name : insert a Confluence code block
|
||||
# --
|
||||
{code}
|
||||
$0
|
||||
{code}
|
||||
21
emacs/.emacs.d/snippets/org-mode/daily
Normal file
21
emacs/.emacs.d/snippets/org-mode/daily
Normal file
@@ -0,0 +1,21 @@
|
||||
#name: daily
|
||||
# --
|
||||
* ❯ Admin, training & maintenance
|
||||
** DEVTR-1 Meetings, email, Slack++
|
||||
** DEVTR-5 System Maintenance
|
||||
** DEVTR-6 Software Delivery
|
||||
** DEVTR-8 Training
|
||||
|
||||
* ❯ Coding
|
||||
|
||||
* ❯ Review
|
||||
|
||||
* ❯ Specification
|
||||
|
||||
* ❯ Support
|
||||
** DEVTR-3 PSERV Assistance
|
||||
** DEVTR-5 Helping out colleagues in R&D
|
||||
|
||||
* ❯ Report
|
||||
#+BEGIN: clocktable :maxlevel 2
|
||||
#+END:
|
||||
1
emacs/.emacs.d/snippets/org-mode/gr
Normal file
1
emacs/.emacs.d/snippets/org-mode/gr
Normal file
@@ -0,0 +1 @@
|
||||
** TODO DEVTR-44 Review - $0
|
||||
5
emacs/.emacs.d/snippets/org-mode/q
Normal file
5
emacs/.emacs.d/snippets/org-mode/q
Normal file
@@ -0,0 +1,5 @@
|
||||
#name : insert a quote
|
||||
# --
|
||||
#+begin_quote
|
||||
$0
|
||||
#+end_quote
|
||||
5
emacs/.emacs.d/snippets/org-mode/src
Normal file
5
emacs/.emacs.d/snippets/org-mode/src
Normal file
@@ -0,0 +1,5 @@
|
||||
#name : insert a source (BASH) declaration
|
||||
# --
|
||||
#+begin_src markdown
|
||||
$0
|
||||
#+end_src
|
||||
1
emacs/.emacs.d/snippets/org-mode/title
Normal file
1
emacs/.emacs.d/snippets/org-mode/title
Normal file
@@ -0,0 +1 @@
|
||||
#+title: $0
|
||||
4
emacs/.emacs.d/snippets/python-mode/app
Normal file
4
emacs/.emacs.d/snippets/python-mode/app
Normal file
@@ -0,0 +1,4 @@
|
||||
#name : app
|
||||
# --
|
||||
app = $1(__name__)
|
||||
$0
|
||||
4
emacs/.emacs.d/snippets/python-mode/def
Normal file
4
emacs/.emacs.d/snippets/python-mode/def
Normal file
@@ -0,0 +1,4 @@
|
||||
#name : def
|
||||
# --
|
||||
def $1($2):
|
||||
$0
|
||||
4
emacs/.emacs.d/snippets/python-mode/im
Normal file
4
emacs/.emacs.d/snippets/python-mode/im
Normal file
@@ -0,0 +1,4 @@
|
||||
#name : im
|
||||
# --
|
||||
from $1 import $2
|
||||
$0
|
||||
6
emacs/.emacs.d/snippets/python-mode/imflask
Normal file
6
emacs/.emacs.d/snippets/python-mode/imflask
Normal file
@@ -0,0 +1,6 @@
|
||||
#name : imflask
|
||||
# --
|
||||
from flask import Flask
|
||||
from flask import render_template
|
||||
from requests import get
|
||||
$0
|
||||
4
emacs/.emacs.d/snippets/python-mode/main
Normal file
4
emacs/.emacs.d/snippets/python-mode/main
Normal file
@@ -0,0 +1,4 @@
|
||||
#name : main
|
||||
# --
|
||||
if __name__ == "__main__":
|
||||
$0
|
||||
6
emacs/.emacs.d/snippets/python-mode/p
Normal file
6
emacs/.emacs.d/snippets/python-mode/p
Normal file
@@ -0,0 +1,6 @@
|
||||
#name : Create @property function
|
||||
# --
|
||||
@property
|
||||
def $1(self):
|
||||
return self._$1
|
||||
$0
|
||||
4
emacs/.emacs.d/snippets/python-mode/pr
Normal file
4
emacs/.emacs.d/snippets/python-mode/pr
Normal file
@@ -0,0 +1,4 @@
|
||||
#name : pr
|
||||
# --
|
||||
print($1)
|
||||
$0
|
||||
4
emacs/.emacs.d/snippets/python-mode/prx
Normal file
4
emacs/.emacs.d/snippets/python-mode/prx
Normal file
@@ -0,0 +1,4 @@
|
||||
#name : prx
|
||||
# --
|
||||
print(etree.tostring($1, encoding='unicode'))
|
||||
$0
|
||||
3
emacs/.emacs.d/snippets/python-mode/render
Normal file
3
emacs/.emacs.d/snippets/python-mode/render
Normal file
@@ -0,0 +1,3 @@
|
||||
#name : render
|
||||
# --
|
||||
return render_template("$1", data=$2)
|
||||
5
emacs/.emacs.d/snippets/python-mode/route
Normal file
5
emacs/.emacs.d/snippets/python-mode/route
Normal file
@@ -0,0 +1,5 @@
|
||||
#name : route
|
||||
# --
|
||||
@app.route("/<$1>$2")
|
||||
def $3($1):
|
||||
$0
|
||||
5
emacs/.emacs.d/snippets/python-mode/route2
Normal file
5
emacs/.emacs.d/snippets/python-mode/route2
Normal file
@@ -0,0 +1,5 @@
|
||||
#name : route
|
||||
# --
|
||||
@app.route("/<$1>/<$2>$3")
|
||||
def $4($1, $2):
|
||||
$0
|
||||
1
emacs/.emacs.d/snippets/rego-mode/package
Normal file
1
emacs/.emacs.d/snippets/rego-mode/package
Normal file
@@ -0,0 +1 @@
|
||||
package ${1:`(replace-regexp-in-string "/" "." (file-name-directory (buffer-file-name)))`}$0
|
||||
1
emacs/.emacs.d/snippets/rego-mode/pr
Normal file
1
emacs/.emacs.d/snippets/rego-mode/pr
Normal file
@@ -0,0 +1 @@
|
||||
print("$1", $2)$0
|
||||
44
emacs/.emacs.d/snippets/sh-mode/args
Normal file
44
emacs/.emacs.d/snippets/sh-mode/args
Normal file
@@ -0,0 +1,44 @@
|
||||
#key: args
|
||||
# --
|
||||
|
||||
read_user_input() {
|
||||
local opts=
|
||||
opts=$(getopt \
|
||||
-o hr:nv \
|
||||
--long help \
|
||||
--long version: \
|
||||
--long dry-run \
|
||||
--long verbose \
|
||||
-n 'parse-options' \
|
||||
-- "$@")
|
||||
if [ $? != 0 ] ; then
|
||||
echo "Failed parsing options." >&2
|
||||
exit 1
|
||||
fi
|
||||
eval set -- "$opts"
|
||||
|
||||
while true; do
|
||||
case "\$1" in
|
||||
-h | --help)
|
||||
print_help;
|
||||
exit 0
|
||||
break;;
|
||||
-r | --version)
|
||||
export version=\$2
|
||||
shift 2;;
|
||||
-n | --dry-run)
|
||||
export dry_run=1
|
||||
shift;;
|
||||
-v | --verbose)
|
||||
export verbose=1
|
||||
shift;;
|
||||
-- )
|
||||
shift;
|
||||
break ;;
|
||||
* )
|
||||
break ;;
|
||||
esac
|
||||
done
|
||||
|
||||
export rest_of_args=$*
|
||||
}
|
||||
3
emacs/.emacs.d/snippets/sh-mode/aw
Normal file
3
emacs/.emacs.d/snippets/sh-mode/aw
Normal file
@@ -0,0 +1,3 @@
|
||||
#name: aw
|
||||
# --
|
||||
awk '{print \$${1:1}\}'$0
|
||||
18
emacs/.emacs.d/snippets/sh-mode/cmd
Normal file
18
emacs/.emacs.d/snippets/sh-mode/cmd
Normal file
@@ -0,0 +1,18 @@
|
||||
#name : cmd
|
||||
# --
|
||||
#! /usr/bin/env bash
|
||||
|
||||
## author: torstein, torstein@skybert.net
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
main() {
|
||||
:
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
|
||||
|
||||
5
emacs/.emacs.d/snippets/sh-mode/cwd
Normal file
5
emacs/.emacs.d/snippets/sh-mode/cwd
Normal file
@@ -0,0 +1,5 @@
|
||||
#name: cwd
|
||||
# --
|
||||
local _cwd=
|
||||
_cwd="$(cd "\$(dirname "\${BASH_SOURCE[0]}")" &> /dev/null && pwd)"
|
||||
$0
|
||||
5
emacs/.emacs.d/snippets/sh-mode/eof
Normal file
5
emacs/.emacs.d/snippets/sh-mode/eof
Normal file
@@ -0,0 +1,5 @@
|
||||
#name : eof
|
||||
# --
|
||||
cat <<EOF
|
||||
$0
|
||||
EOF
|
||||
5
emacs/.emacs.d/snippets/sh-mode/fn
Normal file
5
emacs/.emacs.d/snippets/sh-mode/fn
Normal file
@@ -0,0 +1,5 @@
|
||||
#name : fn
|
||||
# --
|
||||
${1:read_user_input}() {
|
||||
$0
|
||||
}
|
||||
7
emacs/.emacs.d/snippets/sh-mode/fnae
Normal file
7
emacs/.emacs.d/snippets/sh-mode/fnae
Normal file
@@ -0,0 +1,7 @@
|
||||
assertEquals() {
|
||||
test "\$1" = "\$2" || {
|
||||
printf "Failed: Expected: [%s] Actual: [%s]\\n" "\${1}" "\${2}"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
$0
|
||||
6
emacs/.emacs.d/snippets/sh-mode/fo
Normal file
6
emacs/.emacs.d/snippets/sh-mode/fo
Normal file
@@ -0,0 +1,6 @@
|
||||
#name : fo
|
||||
# --
|
||||
for ${1:el} in \$\{${2:list}\}; do
|
||||
echo "\${$1}"
|
||||
$0
|
||||
done
|
||||
19
emacs/.emacs.d/snippets/sh-mode/help
Normal file
19
emacs/.emacs.d/snippets/sh-mode/help
Normal file
@@ -0,0 +1,19 @@
|
||||
#name : help
|
||||
# --
|
||||
_show_help() {
|
||||
cat <<EOF
|
||||
NAME
|
||||
$(basename "\$0")
|
||||
|
||||
SYNOPSIS
|
||||
$(basename "\$0")
|
||||
|
||||
OPTIONS
|
||||
--help Don't panic
|
||||
|
||||
AUTHORS
|
||||
skybert wrote the initial version.
|
||||
|
||||
$0
|
||||
EOF
|
||||
}
|
||||
5
emacs/.emacs.d/snippets/sh-mode/if
Normal file
5
emacs/.emacs.d/snippets/sh-mode/if
Normal file
@@ -0,0 +1,5 @@
|
||||
#name : if
|
||||
# --
|
||||
if [ ${1} ]; then
|
||||
$0
|
||||
fi
|
||||
5
emacs/.emacs.d/snippets/sh-mode/iif
Normal file
5
emacs/.emacs.d/snippets/sh-mode/iif
Normal file
@@ -0,0 +1,5 @@
|
||||
#name : iif
|
||||
# --
|
||||
if [[ ${1} ]]; then
|
||||
$0
|
||||
fi
|
||||
7
emacs/.emacs.d/snippets/sh-mode/main
Normal file
7
emacs/.emacs.d/snippets/sh-mode/main
Normal file
@@ -0,0 +1,7 @@
|
||||
#name : main
|
||||
# --
|
||||
main() {
|
||||
$0
|
||||
}
|
||||
|
||||
main "$@"
|
||||
3
emacs/.emacs.d/snippets/sh-mode/pr
Normal file
3
emacs/.emacs.d/snippets/sh-mode/pr
Normal file
@@ -0,0 +1,3 @@
|
||||
#name : pr
|
||||
# --
|
||||
printf "%s\\\n" "\${$0}"
|
||||
27
emacs/.emacs.d/snippets/sh-mode/shunit
Normal file
27
emacs/.emacs.d/snippets/sh-mode/shunit
Normal file
@@ -0,0 +1,27 @@
|
||||
#name : shunit
|
||||
# --
|
||||
#! /usr/bin/env bash
|
||||
|
||||
# by torstein@skybert.net
|
||||
|
||||
cwd="\$(cd "$(dirname "\${BASH_SOURCE[0]}")" &> /dev/null && pwd)"
|
||||
|
||||
## @override shunit2
|
||||
setUp() {
|
||||
source "\${cwd}/../lib/$(basename "\$0" -test.sh)-lib.sh"
|
||||
}
|
||||
|
||||
## @override shunit2
|
||||
tearDown() {
|
||||
:
|
||||
}
|
||||
|
||||
main() {
|
||||
test -d "\${cwd}"/shunit2 || {
|
||||
git -C "\${cwd}" clone --quiet --depth 1 https://github.com/kward/shunit2.git
|
||||
}
|
||||
|
||||
source "\${cwd}"/shunit2/shunit2
|
||||
}
|
||||
|
||||
main "\$@"
|
||||
21
emacs/.emacs.d/snippets/sh-mode/test
Normal file
21
emacs/.emacs.d/snippets/sh-mode/test
Normal file
@@ -0,0 +1,21 @@
|
||||
#name : test
|
||||
# --
|
||||
#! /usr/bin/env bash
|
||||
|
||||
## author: torstein, torstein@skybert.net
|
||||
|
||||
## @override shunit2
|
||||
setUp() {
|
||||
source "$(dirname "\$0")/../lib/$(basename "\$0" -test.sh).sh"
|
||||
}
|
||||
|
||||
## @override shunit2
|
||||
tearDown() {
|
||||
:
|
||||
}
|
||||
|
||||
main() {
|
||||
. "$(dirname "\$0")"/shunit2/shunit2
|
||||
}
|
||||
|
||||
main "$@"
|
||||
8
emacs/.emacs.d/snippets/sh-mode/tmpdir
Normal file
8
emacs/.emacs.d/snippets/sh-mode/tmpdir
Normal file
@@ -0,0 +1,8 @@
|
||||
#name : tmpdir
|
||||
# --
|
||||
local ${1:tmp_dir}=
|
||||
$1=\$(mktemp -d)
|
||||
|
||||
$0
|
||||
|
||||
rm -rf "\${$1\}"
|
||||
3
emacs/.emacs.d/snippets/sh-mode/v
Normal file
3
emacs/.emacs.d/snippets/sh-mode/v
Normal file
@@ -0,0 +1,3 @@
|
||||
#name : v
|
||||
# --
|
||||
"\${$1}"$0
|
||||
4
emacs/.emacs.d/snippets/sh-mode/va
Normal file
4
emacs/.emacs.d/snippets/sh-mode/va
Normal file
@@ -0,0 +1,4 @@
|
||||
#name : va
|
||||
# --
|
||||
local ${1:dir}=
|
||||
$1=$($0)
|
||||
3
emacs/.emacs.d/snippets/sh-mode/vd
Normal file
3
emacs/.emacs.d/snippets/sh-mode/vd
Normal file
@@ -0,0 +1,3 @@
|
||||
#name : vad
|
||||
# --
|
||||
local ${1:dir}=$0
|
||||
6
emacs/.emacs.d/snippets/sh-mode/wh
Normal file
6
emacs/.emacs.d/snippets/sh-mode/wh
Normal file
@@ -0,0 +1,6 @@
|
||||
#name : wh
|
||||
# --
|
||||
while read -r ${1:f}; do
|
||||
echo "\${$1}"
|
||||
$0
|
||||
done
|
||||
5
emacs/.emacs.d/snippets/web-mode/a
Normal file
5
emacs/.emacs.d/snippets/web-mode/a
Normal file
@@ -0,0 +1,5 @@
|
||||
#name : a
|
||||
# --
|
||||
<a href="$1">
|
||||
$0
|
||||
</a>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user