Skip to content

Instantly share code, notes, and snippets.

#Dokuwiki_Nginx_PHP_test
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
module Dullist
class Actions < Controller
map '/' #this must be called in the derived class??
attr_accessor :tasks
def initialize
super()
@tasks = Task.all
@title = ''
end
r = Regexp.new(
'( (http|https|ftp)://)*'+ #protocol:// 可有可無
'( (\d{1,3}\.){3,3}\d{1,3}|'+ #第二段,這邊可能是 IPv4
'((-|\w)+\.)+(tw|com|aero|us|gr)|'+ #或正常suffix的DN
'((-|\w)+\.)*localhost )'+ #或localhost
'(:\d{1,5})?'+ #:port number
'(/\S+)*', Regexp::EXTENDED) #第一個 / 後面就不管他了
Function.method('curry', function(){
var slice = Array.prototype.slice,
args = slice.apply(arguments),
that = this;
return function(){
var complete_pack = args.concat(slice.apply(arguments));
if( complete_pack.length < that.arity ) {
return that.curry.apply(that, complete_pack);
}
else return that.apply(null, complete_pack);
var fibonacci = function() {
var memo = [0, 1];
var fib = function (n) {
var result = memo[n];
if (typeof result !== 'number') {
result = fib(n - 1) + fib(n - 2);
memo[n] = result;
}
return result;
};
var memoizer = function (memo, fundamental) {
var shell = function (n) {
var result = memo[n];
if (typeof result !== 'number') {
result = fundamental(shell, n);
memo[n] = result;
}
return result;
};
return shell;
var memoizer = function (memo, fundamental) {
var make_query = function(args) {
var i = 0, query = '';
for( ; i < args.length - 1 ; i += 1 ) {
query += args[i] + ',';
}
query += args[i]; // i == args.length - 1
return query;
};
<NotepadPlus>
<UserLang name="Scala" ext="scala">
<Settings>
<Global caseIgnored="no" />
<TreatAsSymbol comment="no" commentLine="yes" />
<Prefix words1="no" words2="no" words3="no" words4="no" />
</Settings>
<KeywordLists>
<Keywords name="Delimiters">\&apos;0&quot;&apos;0</Keywords>
<Keywords name="Folder+">{</Keywords>
LOL
@ @@
@@ @ @@
@@ @@ @@@@ @@@
@@@@@@@@@@@
@@@ @@@@
@@@@@@@ @@@ @@@@@
@@@@@@@ @ @@ @@@
@@@@@@@ @@ @@@@ @@ @
/* list color 字記得改成 416A7A */
pre { margin: 0; }
ol { list-style-type: decimal; }
ol ol, ol ol ol ol, ol ol ol ol ol ol {
list-style-type: none;
counter-reset: item;
margin: 0 0 0 2em;