# -*- mode : snippet -*-
# name : data argument
# key : arg
# --
("$1 " . "$2 ")
# -*- mode : snippet -*-
# name : message
# key : msg
# --
(message "%s" $1 )
# -*- mode : snippet -*-
# name : package
# key : pack
# --
;;; package --- Summary
;;; Commentary:
;;; Code:
$0
(provide '`(file-name-sans-extension (f-filename (buffer-file-name ))) ` )
;;; `(f-filename (buffer-file-name )) ` ends here
# -*- mode : snippet -*-
# name : request
# key : req
# --
(request
"$1 "
:type "$2 "
:headers '(("Authorization" . "Bearer $3 "))
:parser 'buffer-string
:complete (cl-function
(lambda (&key data &allow-other-keys)
(with-output-to-temp-buffer "*request*"
(princ data)
(switch-to-buffer "*request*")
(json-pretty-print-buffer)))))
# -*- mode : snippet -*-
# name : assert
# key : assert
# --
"github.com/stretchr/testify/assert"
comment
# -*- mode : snippet -*-
# name : comment
# key : TODO
# --
// TODO (`(format-time-string " %Y/%m/%d" ) ` ) [abrochard] $0
# key : eq
# name : equal
# --
assert.Equal(t, $1 , $2 )$0
# -*- mode : snippet -*-
# name : fmt
# key : fmt
# --
fmt.Printf("\n\n[ADRIEN] $1 %+v\n\n", $1 )$0
# -*- mode : snippet -*-
# name : func
# key : f
# --
func $1 ($2 ) $3 {
$0
}
# -*- mode : snippet -*-
# name : http
# key : http
# --
w http.ResponseWriter, req *http.Request
# -*- mode : snippet -*-
# name : iferr
# key : iferr
# --
if err != nil {
$1
}
# -*- mode : snippet -*-
# name : method
# key : f*
# --
func ($1 ) $2 ($3 ) $4 {
$0
}
# -*- mode : snippet -*-
# name : package
# key : pack
# --
package `(f-base (f-dirname (buffer-file-name ))) `
# -*- mode : snippet -*-
# name : require
# key : req
# --
require.$1 (t, $0 )
# -*- mode : snippet -*-
# name : return
# key : r
# --
return $0
# -*- mode : snippet -*-
# name : tRun
# key : trun
# --
t.Run("$1 ", func(t *testing.T) {
$0
})
# -*- mode : snippet -*-
# name : test
# key : test
# --
func Test$1 (t *testing.T) {
$0
}
# -*- mode : snippet -*-
# name : console.log
# key : log
# --
console.log($1 );
# -*- mode : snippet -*-
# name : fct
# key : f
# --
($1 ) => {$0 }
# -*- mode : snippet -*-
# name : test
# key : test
# --
local Test$1 () =
assert $0 ;
true;
# -*- mode : snippet -*-
# name : spec
# key : spec
# --
<details><summary><code>$1 </code></summary>
#### Parameters
1. $0
#### Return
</details>
collapsible-markdown-section
# -*- mode : snippet -*-
# name : collapsible-markdown-section
# key : coll
# --
#+HTML: <details> <summary> $1 </summary>
$0
#+HTML: </details>
# -*- mode : snippet -*-
# name : src
# key : src
# --
$0
# -*- mode : snippet -*-
# name : title
# key : :t
# --
#+TITLE: $0
# -*- mode : snippet -*-
# name : use-package
# key : use
# --
** Enable =$1 =
(use-package $1 )
# -*- mode : snippet -*-
# name : dictionary entry
# key : dic
# --
'$1 ' => '$2 ',
# -*- mode : snippet -*-
# name : do while
# key : do
# --
do {
$1
} while ($2 );
# -*- mode : snippet -*-
# name : export
# key : export
# --
echo '<pre>' . var_export($1 , true) . '</pre>';
# -*- mode : snippet -*-
# name : for loop
# key : for
# --
for ($1 = 0; $1 < $2 ; $1 ++) {
$3
}
# -*- mode : snippet -*-
# name : foreach
# key : foreach
# --
foreach ($1 as $2 => $3 ) {
$4
}
# -*- mode : snippet -*-
# name : function
# key : fct
# --
/**
* $1
*
* @param $2 $3
* @return $4
*/
$5 function $1 ($3 )
{
$6
}
header
# -*- mode : snippet -*-
# name : header
# key : header
# --
/**
* $1
* $0
* @return $2
*/
# -*- mode : snippet -*-
# name : implode
# key : implode
# --
implode($1 , $2 )
# key : namespace
# name : namespace
# --
namespace `(replace-regexp-in-string " .$" " ;" (replace-regexp-in-string " ^." " " (replace-regexp-in-string " /" " \\ " (file-name-directory (buffer-file-name )) t t ))) `
# -*- mode : snippet -*-
# name : return
# key : ret
# --
return $1 ;
# -*- mode : snippet -*-
# name : try catch
# key : try
# --
try {
$1
} catch ($2 $e) {
$3
}
# -*- mode : snippet -*-
# name : var dump
# key : dump
# --
var_dump($1 ); exit;
# -*- mode : snippet -*-
# name : while
# key : w
# --
while ($1 ) {
$2
}
# -*- mode : snippet -*-
# name : class
# key : class
# --
class `(s-upper-camel-case (f-no-ext (f-filename (buffer-file-name )))) ` :
def __init__(self, $2 ):
self.$2 = $2
$0
# -*- mode : snippet -*-
# name : def
# key : def
# --
def $1 ($2 ):
$0
# -*- mode : snippet -*-
# name : dic
# key : dic
# --
'$1 ': '$2 ',
# -*- mode : snippet -*-
# name : for
# key : for
# --
for $1 in $2 :
$0
# -*- mode : snippet -*-
# name : if
# key : if
# --
if $1 :
$0
# -*- mode : snippet -*-
# name : main
# key : main
# --
if __name__ == "__main__":
main()
# -*- mode : snippet -*-
# name : p
# key : p
# --
print('Value of $1 is "{}"'.format($1 ))