Skip to content

Instantly share code, notes, and snippets.

View kaosf's full-sized avatar
🏠
Working from home

ka kaosf

🏠
Working from home
View GitHub Profile
(defn exists? [l x]
(> (.indexOf l x) -1))
(require '[clojure.test :refer :all])
(testing "exists?"
(is (exists? [1 2 3] 1))
(is (exists? [1 2 3] 2))
(is (not (exists? [1 2 3] 0))))
; (sum 10) ;-> (+ 10 (sum 9))
; (sum 9) ;-> (+ 9 (sum 8))
; ...
; (sum 1) ;-> (+ 1 0)
(defn sum [n] ; foldr
(case n
1 1 ;(+ 1 0) ; 0 is initial value
(+ n (sum (dec n)))))
; [i s] -> [10 0] -> [9 10] -> [8 19] -> ... -> [1 54] -> [0 55]
2014-03-07T21:00:22.536342+00:00 app[web.1]: Exception in thread "main" java.lang.IllegalArgumentException: db-spec {:pool #<Delay@4e0bd5df: :pending>, :options {:naming {:keys #<core$identity clojure.core$identity@591bfcbe>, :fields #<core$identity clojure.core$identity@591bfcbe>}, :delimiters ["\"" "\""], :alias-delimiter " AS ", :subprotocol "postgresql"}} is missing a required parameter
2014-03-07T21:00:22.536495+00:00 app[web.1]: at clojure.java.jdbc$get_connection.invoke(jdbc.clj:192)
2014-03-07T21:00:22.536713+00:00 app[web.1]: at precure_dcd.models.schema$create_users_table.invoke(schema.clj:19)
2014-03-07T21:00:22.536713+00:00 app[web.1]: at clojure.lang.RestFn.invoke(RestFn.java:423)
2014-03-07T21:00:22.536713+00:00 app[web.1]: at precure_dcd.handler$init.invoke(handler.clj:36)
2014-03-07T21:00:22.536713+00:00 app[web.1]: at precure_dcd.models.schema$create_tables.invoke(schema.clj:34)
2014-03-07T21:00:22.536869+00:00 app[web.1]: at user$eval54.invoke(form-init3139196912543278507.c
19 bingo
x x x
x x x x
x x x x x
x x x x
x x x
25 bingo
x x x x x
x x x x x
@kaosf
kaosf / favstar.rb
Created April 2, 2014 06:54 — forked from siyo/favstar.rb
0
Earthquake.init do
command %r|^:favstar\s*(.+)*|, :as => :favstar do |m|
browse 'http://favstar.fm/me'
end
end
node -v
#v0.10.22
npm -v
#1.3.14
# ref. https://github.com/mizchi-sandbox/try-vue.js
hub clone mizchi-sandbox/try-vue.js
cd try-vue.js
npm install -g coffee-script browserify mocha-phantomjs
npm install
# How to setup Ruby 2.1.1 on Lubuntu 14.04
sudo aptitude install curl zlib1g-dev libssl-dev libreadline6-dev
git clone https://github.com/sstephenson/rbenv.git $HOME/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> $HOME/.zshenv
echo 'eval "$(rbenv init -)"' >> $HOME/.zshenv
exec $SHELL -l
mkdir -p $HOME/.rbenv/plugins
git clone https://github.com/sstephenson/ruby-build.git $HOME/.rbenv/plugins/ruby-build
git clone https://github.com/ianheggie/rbenv-binstubs.git $HOME/.rbenv/plugins/rbenv-binstubs
curl -fsSL https://gist.github.com/mislav/a18b9d7f0dc5b9efc162.txt | rbenv install --patch 2.1.1

./configure && make && make install && make uninstall

Step 1.

A simple minimal project that you can only do ./configure and make.

Environment

  • OS: Ubuntu 14.04
  • automake: (GNU automake) 1.14.1
@kaosf
kaosf / Makefile.in
Last active August 29, 2015 14:01
Easy configure and Makefile.in suite; ./configure --prefix=$HOME && make && make install && make uninstall
PREFIX=
all:
install:
mkdir -p $(PREFIX)/bin
cp program $(PREFIX)/bin
uninstall:
rm $(PREFIX)/bin/program
[ 5 of 19] Compiling Data.Vector.Fusion.Stream.Monadic ( Data/Vector/Fusion/Stream/Monadic.hs, dist/build/Data/Vector/Fusion/Stream/Monadic.o )
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package primitive-0.5.2.1 ... <command line>: can't load .so/.DLL for: libHSprimitive-0.5.2.1.so (libHSprimitive-0.5.2.1.so: cannot open shared object file: No such file or directory)
Failed to install vector-0.10.9.1
cabal: Error: some packages failed to install:
aeson-0.7.0.3 depends on vector-0.10.9.1 which failed to install.
bifunctors-4.1.1.1 depends on distributive-0.4.3.2 which failed to install.
comonad-4.2 depends on distributive-0.4.3.2 which failed to install.