This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #/bin/bash | |
| # stolen from http://kingstonlabs.co.uk/blog/how-to-install-solr-36-on-ubuntu-1204/ | |
| sudo apt-get update; sudo apt-get upgrade -y; | |
| # Install solr and jetty packages | |
| sudo apt-get install jetty openjdk-7-jdk libjetty-extra unzip -y | |
| cd ~; | |
| wget http://www.eng.lsu.edu/mirrors/apache/lucene/solr/3.6.2/apache-solr-3.6.2.tgz | |
| tar -xvzf *.tgz; | |
| rm *.tgz; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defun sublime-text-2 () | |
| (interactive) | |
| (color-theme-install | |
| '(sublime-text-2 | |
| ((background-color . "#171717") | |
| (background-mode . light) | |
| (border-color . "#1a1a1a") | |
| (cursor-color . "#fce94f") | |
| (foreground-color . "#cfbfad") | |
| (mouse-color . "black")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defadvice find-tag-at-point (before auto-visti-tags) | |
| "Load default TAGS file from home directory if needed" | |
| (visit-tags-table (concat (projectile-project-root) "TAGS"))) | |
| (ad-activate 'find-tag-at-point) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defun run-file-or-spec () | |
| "If we're in a spec file - run rspec; in other case use quickrun" | |
| (interactive) | |
| (let ((file-name-ending (substring (file-name-nondirectory (buffer-file-name)) -8 nil))) | |
| (if (string= "_spec.rb" file-name-ending) | |
| (rspec-verify) | |
| (quickrun)))) | |
| (bind "<f14>" 'run-file-or-spec) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns word_wrap_cata_clojure.test.core | |
| (:use [word_wrap_cata_clojure.core]) | |
| (:use [midje.sweet]) | |
| (:use clojure.pprint)) | |
| ;; Source: http://blog.8thlight.com/uncle-bob/2013/01/07/FPBE3-Do-the-rules-change.html | |
| (facts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defun get-candidate-by-email (email) | |
| (comint-send-string (inf-ruby-proc) | |
| (format "candidate = User.find_by_email('%s').try(:profile)" email))) | |
| (defun get-your-candidate () | |
| (interactive) | |
| (get-candidate-by-email "someemail@gmail.com")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defun welcome-page-handler (httpcon) | |
| (elnode-http-start httpcon "200" '("Content-type" . "text/html")) | |
| (elnode-http-return httpcon (my-main-page))) | |
| (defun html (x) | |
| "Return valid HTML code constructed from passed list" | |
| (if (not (listp x)) | |
| x | |
| (let ((tag (car x)) | |
| (body (cdr x))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (html '("html" | |
| ("head" | |
| ("body" | |
| ("div" | |
| ("h1" "Hello world") | |
| ("div" "I don't" ("b" " like ") "plain html page look") | |
| ("br") | |
| ("div" ("attributes" "class=span9 style=\"color:red\"") | |
| "This is a webpage served by elnode!")))))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defun html (x) | |
| "Return valid HTML code constructed from passed list" | |
| (if (not (listp x)) | |
| x | |
| (let ((tag (car x)) | |
| (body (cdr x))) | |
| (if (and (listp (car body)) (string= "attributes" (first (car body)))) | |
| (concat "<" tag " " (car (cdr (car body))) ">" | |
| (apply 'concat (mapcar 'html (cdr body))) | |
| "</" tag ">") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defun welcome-page-handler (httpcon) | |
| (elnode-http-start httpcon "200" '("Content-type" . "text/html")) | |
| (elnode-http-return httpcon "<html><body><h1>Hello there!!</h1></body></html>")) | |
| (elnode-start 'welcome-page-handler :port 8010 :host "localhost") |