Skip to content

Instantly share code, notes, and snippets.

@nabe256
nabe256 / fib1.hs
Created April 20, 2012 19:39
Fibonacci number
fib :: Num a => a -> a
fib 0 = 0
fib 1 = 1
fib n = fib(n-2) + fib(n-1)
main = mapM_ print $ map fib [0..9]
@nabe256
nabe256 / fib2.hs
Created April 20, 2012 19:41
Fibonacci number 2
fib :: Num a => a -> [a]
fib 0 = [0]
fib 1 = [0,1]
fib n = (fib(n-1)) ++ [last(fib(n-2)) + last(fib(n-1))]
main = mapM_ print $ map fib [0..9]
@nabe256
nabe256 / fib3.hs
Created April 20, 2012 19:43
Fibonacci number 3
fib :: Num a => [a]
fib = 0:1:zipWith (+) (fib) (tail(fib))
main = print $ take 10 fib
@nabe256
nabe256 / gist:5183954
Created March 17, 2013 22:42
NSEG #37 Code Golf
import System.Environment
import Data.Char
knum = "〇一二三四五六七八九"
kketa = "十百千"
main = do
args <- getArgs
if length args == 0
then putStrLn "input: number"
--- ProofGeneral-4.3pre130327.orig/Makefile 2013-01-16 06:48:49.000000000 +0900
+++ ProofGeneral-4.3pre130327/Makefile 2013-04-10 09:45:49.000000000 +0900
@@ -62,7 +62,7 @@
# only during compilation. Another idea: put a function in proof-site
# to output the compile-time load path and ELISP_DIRS so these are set
# just in that one place.
-BYTECOMP = $(BATCHEMACS) -eval '(setq load-path (append (mapcar (lambda (d) (concat "${PWD}/" (symbol-name d))) (quote (${ELISP_DIRS}))) load-path))' -eval '(progn (require (quote bytecomp)) (require (quote mouse)) (require (quote tool-bar)) (require (quote fontset)) (setq byte-compile-warnings (remove (quote cl-functions) (remove (quote noruntime) byte-compile-warning-types))) (setq byte-compile-error-on-warn t))' -f batch-byte-compile
+BYTECOMP = $(BATCHEMACS) -eval '(setq load-path (append (mapcar (lambda (d) (concat "${PWD}/" (symbol-name d))) (quote (${ELISP_DIRS}))) load-path))' -eval '(progn (require (quote bytecomp)) (require (quote mouse)) (require (quote tool-b
diff --git a/index.js b/index.js
index 0bcad82..6344b71 100755
--- a/index.js
+++ b/index.js
@@ -51,7 +51,8 @@ function request(str, cb) {
method: 'POST',
headers: {
'Content-length': str.length,
- 'Content-Type': 'text/plain'
+ 'Content-Type': 'text/plain',
"=============================================================================
" Description: UTF-8化と文字コード自動認識設定
" http://www.kawaz.jp/pukiwiki/?vimを改変
" Author: fuenor <[email protected]>
" http://sites.google.com/site/fudist/Home/vim-nihongo-ban/vim-utf8
" Last Modified: 2011-03-06 13:03
" Version: 1.18
"=============================================================================
let s:MSWindows = has('win95') + has('win16') + has('win32') + has('win64')
# Tomcat
```
$ sudo apt-get install lamp-server^
$ sudo apt-get install tomcat7 tomcat7-admin tomcat7-user
$ sudoedit /etc/default/tomcat7
JAVA_HOME=/usr/lib/jvm/default-java
$ sudoedit /etc/tomcat7/tomcat-users.xml
<tomcat-users>
<user username="admin" password="pass" roles="manager-gui,admin-gui"/>
@nabe256
nabe256 / gist:3a927ee6da681ef3cc5a
Created November 2, 2014 09:36
git bare repository
$ cd /var/git
(a)
$ git clone --bare /var/www/html/project project.git
(b)
$ mkdir project.git ; sudo chown -R user:user project.git
$ cd project.git ; git init --bare
$ cd /var/www/html/project ; git push /var/git/project.git master
$ cd /var/git/project.git
$ sudo apt-get install nginx
$ sudoedit /etc/apache2/apache2.conf /etc/apache2/ports.conf
#Listen 80
Listen 8080
$ sudo service apache2 restart
$ sudo service nginx start
$ sudo apt-get install php5-fpm php5-cgi
$ sudo service php5-fpm start
$ sudoedit /etc/nginx/sites-available/default