merged whole dir from trunk r366 (the objc/prop snippet should be reverted)

This commit is contained in:
capitaomorte
2009-07-16 16:53:46 +00:00
274 changed files with 2750 additions and 152 deletions

View File

@@ -3,6 +3,6 @@
class ${1:Name}
{
public:
$1($2);
virtual ~$1();
${1:$(yas/substr text "[^: ]*")}($2);
virtual ~${1:$(yas/substr text "[^: ]*")}();
};

View File

@@ -0,0 +1,3 @@
#name : namespace ...
# --
namespace

View File

@@ -0,0 +1,3 @@
#name : template <typename ...>
# --
template <typename ${T}>

View File

@@ -0,0 +1,7 @@
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
#name : private attribute ....;
# --
/// <summary>
/// $3
/// </summary>
private $1 $2;

View File

@@ -0,0 +1,21 @@
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
#name : private attribute ....; public property ... ... { ... }
# --
/// <summary>
/// $3
/// </summary>
private $1 $2;
/// <summary>
/// $4
/// </summary>
/// <value>$5</value>
public $1 $2
{
get {
return this.$2;
}
set {
this.$2 = value;
}
}

View File

@@ -0,0 +1,21 @@
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
#name : private _attribute ....; public Property ... ... { ... }
# --
/// <summary>
/// $3
/// </summary>
private $1 ${2:$(if (> (length text) 0) (format "_%s%s" (downcase (substring text 0 1)) (substring text 1 (length text))) "")};
/// <summary>
/// ${3:Description}
/// </summary>
/// <value><c>$1</c></value>
public ${1:Type} ${2:Name}
{
get {
return this.${2:$(if (> (length text) 0) (format "_%s%s" (downcase (substring text 0 1)) (substring text 1 (length text))) "")};
}
set {
this.${2:$(if (> (length text) 0) (format "_%s%s" (downcase (substring text 0 1)) (substring text 1 (length text))) "")} = value;
}
}

View File

@@ -0,0 +1,21 @@
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
#name : class ... { ... }
# --
${5:public} class ${1:Name}
{
#region Ctor & Destructor
/// <summary>
/// ${3:Standard Constructor}
/// </summary>
public $1($2)
{
}
/// <summary>
/// ${4:Default Destructor}
/// </summary>
public ~$1()
{
}
#endregion
}

View File

@@ -0,0 +1,6 @@
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
#name : /// <summary> ... </summary>
# --
/// <summary>
/// $1
/// </summary>

View File

@@ -0,0 +1,4 @@
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
#name : /// <param name="..."> ... </param>
# --
/// <param name="$1">$2</param>

View File

@@ -0,0 +1,4 @@
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
#name : /// <param name="..."> ... </param>
# --
/// <returns>$1</returns>

View File

@@ -0,0 +1,4 @@
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
#name : /// <exception cref="..."> ... </exception>
# --
/// <exception cref="$1">$2</exception>

View File

@@ -0,0 +1,10 @@
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
#name : public void Method { ... }
# --
/// <summary>
/// ${5:Description}
/// </summary>${2:$(if (string= (upcase text) "VOID") "" (format "%s%s%s" "\n/// <returns><c>" text "</c></returns>"))}
${1:public} ${2:void} ${3:MethodName}($4)
{
$0
}

View File

@@ -0,0 +1,7 @@
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
#name : namespace .. { ... }
# --
namespace $1
{
$0
}

View File

@@ -0,0 +1,16 @@
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
#name : property ... ... { ... }
# --
/// <summary>
/// $5
/// </summary>
/// <value>$6</value>
$1 $2 $3
{
get {
return this.$4;
}
set {
this.$4 = value;
}
}

View File

@@ -0,0 +1,6 @@
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
#name : #region ... #endregion
# --
#region $1
$0
#endregion

View File

@@ -0,0 +1,4 @@
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
#name : using ...;
# --
using $1;

View File

@@ -0,0 +1,4 @@
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
#name : using System;
# --
using System;

View File

@@ -0,0 +1,4 @@
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
#name : using System....;
# --
using System.$1;

View File

@@ -0,0 +1,13 @@
#name : foo { ... } ; setFoo { ... }
# --
- (${1:id})${2:foo}
{
return $2;
}
- (void)set${2:$(capitalize text)}:($1)aValue
{
[$2 autorelease];
$2 = [aValue retain];
}
$0

View File

@@ -0,0 +1,11 @@
TITLE: Emacs Idiom Template Set. Version 1. 2009-02-22
DESCRIPTION: Some useful templates for emacs lisp. This template set is based on useful elisp idioms on common tasks.
LICENSING: GPL version 3.
AUTHOR: Xah Lee
Home Page: latest version at:
• Emacs Lisp Idiom Templates
http://xahlee.org/emacs/elisp_idiom_templates.html

View File

@@ -0,0 +1,11 @@
#name : function template
#contributor : Xah Lee
# --
(defun $1 ()
"thisandthat."
(interactive)
(let (var1)
(setq var1 some)
$0
)
)

View File

@@ -0,0 +1,16 @@
#name : process marked files in dired
#contributor : Xah Lee
# --
;; idiom for processing a list of files in dired's marked files
;; suppose myProcessFile is your function that takes a file path
;; and do some processing on the file
(defun dired-myProcessFile ()
"apply myProcessFile function to marked files in dired."
(interactive)
(require 'dired)
(mapc 'myProcessFile (dired-get-marked-files))
)
;; to use it, type M-x dired-myProcessFile

View File

@@ -0,0 +1,17 @@
#name : a function that process a file
#contributor : Xah Lee
# --
(defun doThisFile (fpath)
"Process the file at path FPATH ..."
(let ()
;; create temp buffer without undo record or font lock. (more efficient)
;; first space in temp buff name is necessary
(set-buffer (get-buffer-create " myTemp"))
(insert-file-contents fpath nil nil nil t)
;; process it ...
;; (goto-char 0) ; move to begining of file's content (in case it was open)
;; ... do something here
;; (write-file fpath) ;; write back to the file
(kill-buffer " myTemp")))

View File

@@ -0,0 +1,17 @@
#name : read lines of a file
#contributor : Xah Lee
# --
(defun read-lines (filePath)
"Return a list of lines in FILEPATH."
(with-temp-buffer
(insert-file-contents filePath)
(split-string
(buffer-string) "\n" t)) )
;; process all lines
(mapc
(lambda (aLine)
(message aLine) ; do your stuff here
)
(read-lines "inputFilePath")
)

View File

@@ -0,0 +1,17 @@
#name : find and replace on region
#contributor : Xah Lee
# --
(defun replace-html-chars-region (start end)
"Replace “<” to “&lt;” and other chars in HTML.
This works on the current region."
(interactive "r")
(save-restriction
(narrow-to-region start end)
(goto-char (point-min))
(while (search-forward "&" nil t) (replace-match "&amp;" nil t))
(goto-char (point-min))
(while (search-forward "<" nil t) (replace-match "&lt;" nil t))
(goto-char (point-min))
(while (search-forward ">" nil t) (replace-match "&gt;" nil t))
)
)

View File

@@ -0,0 +1,4 @@
#name : grab buffer substring
#contributor : Xah Lee
# --
(setq $0 (buffer-substring-no-properties myStartPos myEndPos))

View File

@@ -0,0 +1,4 @@
#name : grab word under cursor
#contributor : Xah Lee
# --
(setq $0 (thing-at-point 'symbol))

View File

@@ -0,0 +1,6 @@
#name : traversing a directory
#contributor : Xah Lee
# --
;; apply a function to all files in a dir
(require 'find-lisp)
(mapc 'my-process-file (find-lisp-find-files "~/myweb/" "\\.html$"))

View File

@@ -0,0 +1,27 @@
#name : Command that works on region or word
#contributor : Xah Lee
# --
;; example of a command that works on current word or text selection
(defun down-case-word-or-region ()
"Lower case the current word or text selection."
(interactive)
(let (pos1 pos2 meat)
(if (and transient-mark-mode mark-active)
(setq pos1 (region-beginning)
pos2 (region-end))
(setq pos1 (car (bounds-of-thing-at-point 'symbol))
pos2 (cdr (bounds-of-thing-at-point 'symbol))))
; now, pos1 and pos2 are the starting and ending positions
; of the current word, or current text selection if exists
;; put your code here.
$0
;; Some example of things you might want to do
(downcase-region pos1 pos2) ; example of a func that takes region as args
(setq meat (buffer-substring-no-properties pos1 pos2)) ; grab the text.
(delete-region pos1 pos2) ; get rid of it
(insert "newText") ; insert your new text
)
)

View File

@@ -0,0 +1,4 @@
#name : after ... ->
# --
after
$1 -> $0

View File

@@ -0,0 +1,5 @@
#name : begin ... end
# --
begin
$0
end

View File

@@ -0,0 +1,4 @@
#name : -behaviour(...).
# --
-behaviour(${1:gen_server}).
$0

View File

@@ -0,0 +1,5 @@
#name : case ... of ... end
# --
case $1 of
$0
end

View File

@@ -0,0 +1,4 @@
#name : -compile(...).
# --
-compile([${1:export_all}]).
$0

View File

@@ -0,0 +1,4 @@
#name : -define(...,...).
# --
-define($1,$2).
$0

View File

@@ -0,0 +1,3 @@
#name : fun (...) -> ... end
# --
fun ($1) -> $0 end

View File

@@ -0,0 +1,6 @@
#name : if ... -> ... ; true -> ... end
# --
if
$1 -> $2;
true -> $0
end

View File

@@ -0,0 +1,5 @@
#name : -ifdef(...). ... -endif.
# --
-ifdef($1).
$0
-endif.

View File

@@ -0,0 +1,5 @@
#name : -ifndef(...). ... -endif.
# --
-ifndef($1).
$0
-endif.

View File

@@ -0,0 +1,4 @@
#name : -include("...").
# --
-include("$1").
$0

View File

@@ -0,0 +1,4 @@
#name : -include_lib("...").
# --
-include_lib("$1").
$0

View File

@@ -0,0 +1,8 @@
#name : loop(...) -> receive _ -> loop(...) end.
# --
${1:loop}($2) ->
receive
${3:_} ->
$1($2)
end.
$0

View File

@@ -0,0 +1,5 @@
#name : receive ... -> ... end
# --
receive
$1 -> $0
end

View File

@@ -0,0 +1,6 @@
#name : receive after ... -> ... end
# --
receive
after
$1 -> $0
end

View File

@@ -0,0 +1,4 @@
#name : -record(...,{...}).
# --
-record($1,{$2}).
$0

View File

@@ -0,0 +1,7 @@
#name : try ... of ... catch after end
# --
try $1 of
$0
catch
after
end

View File

@@ -0,0 +1,4 @@
#name : -undef(...).
# --
-undef($1).
$0

View File

@@ -0,0 +1,5 @@
#contributor : Rodrigo Setti <rodrigosetti@gmail.com>
#name : <dd> ... </dd>
#group : list
# --
<dd>$1</dd>

View File

@@ -1,3 +1,3 @@
#name : <div...>...</div>
# --
<div$1>$0</div>
<div${1: id="${2:some_id}"}${3: class="${4:some_class}"}>$0</div>

View File

@@ -0,0 +1,7 @@
#contributor : Rodrigo Setti <rodrigosetti@gmail.com>
#name : <dl> ... </dl>
#group : list
# --
<dl>
$0
</dl>

View File

@@ -0,0 +1,7 @@
#contributor : Rodrigo Setti <rodrigosetti@gmail.com>
#name : <dl> ... </dl>
#group : list
# --
<dl id="$1">
$0
</dl>

View File

@@ -1,3 +1,4 @@
#name : Doctype HTML 4.01 Strict
#group : meta
# --
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

View File

@@ -1,3 +1,4 @@
#name : DocType XHTML 1.0 frameset
#group : meta
# --
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

View File

@@ -1,3 +1,4 @@
#name : DocType XHTML 1.1
#group : meta
# --
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

View File

@@ -1,3 +1,4 @@
#name : DocType XHTML 1.0 Strict
#group : meta
# --
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

View File

@@ -1,3 +1,4 @@
#name : DocType XHTML 1.0 Transitional
#group : meta
# --
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

View File

@@ -0,0 +1,5 @@
#contributor : Rodrigo Setti <rodrigosetti@gmail.com>
#name : <dt> ... </dt>
#group : list
# --
<dt>$1</dt>

View File

@@ -1,4 +1,5 @@
#contributor : Jimmy Wu <frozenthrone88@gmail.com>
#name : <h1>...</h1>
#group : header
# --
<h1>$1</h1>

View File

@@ -1,4 +1,5 @@
#contributor : Jimmy Wu <frozenthrone88@gmail.com>
#name : <h2>...</h2>
#group : header
# --
<h2>$1</h2>

View File

@@ -1,4 +1,5 @@
#contributor : Jimmy Wu <frozenthrone88@gmail.com>
#name : <h3>...</h3>
#group : header
# --
<h3>$1</h3>

View File

@@ -1,4 +1,5 @@
#contributor : Jimmy Wu <frozenthrone88@gmail.com>
#name : <h4>...</h4>
#group : header
# --
<h4>$1</h4>

View File

@@ -1,4 +1,5 @@
#contributor : Jimmy Wu <frozenthrone88@gmail.com>
#name : <h5>...</h5>
#group : header
# --
<h5>$1</h5>

View File

@@ -1,4 +1,5 @@
#contributor : Jimmy Wu <frozenthrone88@gmail.com>
#name : <h6>...</h6>
#group : header
# --
<h6>$1</h6>

View File

@@ -1,4 +1,5 @@
#contributor : Jimmy Wu <frozenthrone88@gmail.com>
#name : <li>...</li>
#group : list
# --
<li>$1</li>

View File

@@ -1,4 +1,5 @@
#contributor : Jimmy Wu <frozenthrone88@gmail.com>
#name : <li class="...">...</li>
#group : list
# --
<li class="$1">$2</li>

View File

@@ -1,4 +1,5 @@
#contributor : Jimmy Wu <frozenthrone88@gmail.com>
#group : meta
#name : <meta name="..." content="..." />
# --
<meta name="${1:generator}" content="${2:content}" />

View File

@@ -1,4 +1,5 @@
#contributor : Jimmy Wu <frozenthrone88@gmail.com>
#name : <meta http-equiv="..." content="..." />
#group : meta
# --
<meta name="${1:Content-Type}" content="${2:text/html; charset=UTF-8}" />

View File

@@ -1,5 +1,6 @@
#contributor : Jimmy Wu <frozenthrone88@gmail.com>
#name : <ol>...</ol>
#group : list
# --
<ol>
$0

View File

@@ -1,5 +1,6 @@
#contributor : Jimmy Wu <frozenthrone88@gmail.com>
#name : <ol class="...">...</ol>
#group : list
# --
<ol class="$1">
$0

View File

@@ -1,5 +1,6 @@
#contributor : Jimmy Wu <frozenthrone88@gmail.com>
#name : <ol id="...">...</ol>
#group : list
# --
<ol id="$1">
$0

View File

@@ -1,5 +1,6 @@
#contributor : Jimmy Wu <frozenthrone88@gmail.com>
#name : <table ...>...</table>
#group : table
# --
<table width="$1" cellspacing="$2" cellpadding="$3" border="$4">
$0

View File

@@ -1,4 +1,5 @@
#contributor : Jimmy Wu <frozenthrone88@gmail.com>
#name : <td>...</td>
#group : table
# --
<td$1>$2</td>

View File

@@ -1,4 +1,5 @@
#contributor : Jimmy Wu <frozenthrone88@gmail.com>
#name : <th>...</th>
#group : table
# --
<th$1>$2</th>

View File

@@ -1,5 +1,6 @@
#contributor : Jimmy Wu <frozenthrone88@gmail.com>
#name : <tr>...</tr>
#group : table
# --
<tr>
$0

View File

@@ -1,5 +1,6 @@
#contributor : Jimmy Wu <frozenthrone88@gmail.com>
#name : <ul>...</ul>
#group : list
# --
<ul>
$0

View File

@@ -1,5 +1,6 @@
#contributor : Jimmy Wu <frozenthrone88@gmail.com>
#name : <ul class="...">...</ul>
#group : list
# --
<ul class="$1">
$0

View File

@@ -1,5 +1,6 @@
#contributor : Jimmy Wu <frozenthrone88@gmail.com>
#name : <ul id="...">...</ul>
#group : list
# --
<ul id="$1">
$0

View File

@@ -0,0 +1,7 @@
#contributor : Rodrigo Setti <rodrigosetti@gmail.com>
#name : \begin{environment} ... \end{environment}
# --
\begin{${1:environment}}
$0
\end{$1}

View File

@@ -0,0 +1,6 @@
#contributor : Anders Bach Nielsen <abachn@abachn.net>
#name : <body>...</body>
# --
<body$1>
$0
</body>

View File

@@ -0,0 +1,4 @@
#contributor : Anders Bach Nielsen <abachn@abachn.net>
#name : <br />
# --
<br />

View File

@@ -0,0 +1,6 @@
#contributor : Anders Bach Nielsen <abachn@abachn.net>
#name : <code>...</code>
# --
<code>
$0
</code>

View File

@@ -0,0 +1,4 @@
#contributor : Anders Bach Nielsen <abachn@abachn.net>
#name : <div...>...</div>
# --
<div$1>$0</div>

View File

@@ -0,0 +1,5 @@
#contributor : Anders Bach Nielsen <abachn@abachn.net>
#name : DocType XHTML 1.1
#group : meta
# --
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

View File

@@ -0,0 +1,5 @@
#contributor : Anders Bach Nielsen <abachn@abachn.net>
#name : DocType XHTML 1.0 Strict
#group : meta
# --
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

View File

@@ -0,0 +1,5 @@
#contributor : Anders Bach Nielsen <abachn@abachn.net>
#name : DocType XHTML 1.0 Transitional
#group : meta
# --
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

View File

@@ -0,0 +1,6 @@
#contributor : Anders Bach Nielsen <abachn@abachn.net>
#name :<form method="..." action="..."></form>
# --
<form method="$1" action="$2">
$0
</form>

View File

@@ -0,0 +1,5 @@
#contributor : Anders Bach Nielsen <abachn@abachn.net>
#name : <h1>...</h1>
#group : header
# --
<h1>$1</h1>

View File

@@ -0,0 +1,5 @@
#contributor : Anders Bach Nielsen <abachn@abachn.net>
#name : <h2>...</h2>
#group : header
# --
<h2>$1</h2>

View File

@@ -0,0 +1,5 @@
#contributor : Anders Bach Nielsen <abachn@abachn.net>
#name : <h3>...</h3>
#group : header
# --
<h3>$1</h3>

View File

@@ -0,0 +1,5 @@
#contributor : Anders Bach Nielsen <abachn@abachn.net>
#name : <h4>...</h4>
#group : header
# --
<h4>$1</h4>

View File

@@ -0,0 +1,5 @@
#contributor : Anders Bach Nielsen <abachn@abachn.net>
#name : <h5>...</h5>
#group : header
# --
<h5>$1</h5>

View File

@@ -0,0 +1,5 @@
#contributor : Anders Bach Nielsen <abachn@abachn.net>
#name : <h6>...</h6>
#group : header
# --
<h6>$1</h6>

View File

@@ -0,0 +1,6 @@
#contributor : Anders Bach Nielsen <abachn@abachn.net>
#name : <head>...</head>
# --
<head>
$0
</head>

View File

@@ -0,0 +1,4 @@
#contributor : Anders Bach Nielsen <abachn@abachn.net>
#name : <hr />
# --
<hr />

View File

@@ -0,0 +1,4 @@
#contributor : Anders Bach Nielsen <abachn@abachn.net>
#name : <a href="...">...</a>
# --
<a href="$1">$2</a>

View File

@@ -0,0 +1,6 @@
#contributor : Anders Bach Nielsen <abachn@abachn.net>
#name : <html xmlns="...">...</html>
# --
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="${1:en}" lang="${2:en}">
$0
</html>

View File

@@ -0,0 +1,4 @@
#contributor : Anders Bach Nielsen <abachn@abachn.net>
#name : <img src="..." alt="..." />
# --
<img src="$1" alt="$2" />

View File

@@ -0,0 +1,4 @@
#contributor : Anders Bach Nielsen <abachn@abachn.net>
#name : <input ... />
# --
<input type="$1" name="$2" value="$3" />

View File

@@ -0,0 +1,4 @@
#contributor : Anders Bach Nielsen <abachn@abachn.net>
#name : <li>...</li>
# --
<li>$1</li>

View File

@@ -0,0 +1,4 @@
#contributor : Anders Bach Nielsen <abachn@abachn.net>
#name : <link stylesheet="..." />
# --
<link rel="${1:stylesheet}" href="${2:url}" type="${3:text/css}" media="${4:screen}" />

Some files were not shown because too many files have changed in this diff Show More