This file contains 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
private Map<String, Set<Rule>> ruleSets; | |
@Override | |
public Rule findRule(String ruleSetName, String route, String method) { | |
Set<Rule> rules = ruleSets.get(ruleSetName); | |
if (rules == null) | |
rules = new HashSet<>(); | |
Optional<Rule> detectedRule = rules.stream() | |
.filter(rule -> RouteMatcher.match(rule.getRoute(), route) |
This file contains 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
netstat -anp tcp | grep 8080 | |
lsof -i :8080 | |
kill -9 34334 |
This file contains 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
BEGIN | |
FOR cur_rec IN (SELECT object_name, object_type FROM user_objects | |
WHERE object_type IN ('TABLE','VIEW','PACKAGE','PROCEDURE','FUNCTION','SEQUENCE')) | |
LOOP | |
BEGIN | |
IF cur_rec.object_type = 'TABLE' | |
THEN | |
EXECUTE IMMEDIATE 'DROP ' || cur_rec.object_type || ' "' || cur_rec.object_name || '" CASCADE CONSTRAINTS'; | |
ELSE | |
EXECUTE IMMEDIATE 'DROP ' || cur_rec.object_type || ' "' || cur_rec.object_name || '"'; |
This file contains 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
# Create a clojure app (template for openshift) via cartridge | |
rhc app create myapp http://cartreflect-claytondev.rhcloud.com/github/jirkapenzes/clojure-cartridge | |
# Push your code from Github to Openshift | |
git remote add openshift -f <openshift-git-repo-url> | |
git push openshift HEAD:master -f | |
# You can check your deployment state via Openshift log | |
rhc tail |
This file contains 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
(def conversions | |
{ :do-nothing #(do %) }) |
This file contains 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
(defprotocol Event | |
(scheduled-time [this]) | |
(execute [this])) | |
(defn simulate [event] | |
(synchronize-time (scheduled-time event)) | |
(execute event)) | |
This file contains 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 jpenzes.swap (:require [clojure.test :refer :all])) | |
(defn swap [v i1 i2] | |
(let [t (get v i1)] | |
(assoc (assoc v i1 (get v i2)) i2 t))) | |
(deftest swap-test | |
(testing "Should swap two items by index in a vector" | |
(let [test-vector [1 2 3 4 5 6 7 8 9] | |
expected [1 8 3 4 5 6 7 2 9]] |
This file contains 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
;; File is backed up at /Users/jpenzes/Library/Application Support/LightTable/User/user.behaviors.bak | |
[ | |
[:app :lt.objs.style/set-skin "dark"] | |
[:app :lt.objs.style/font-settings "consolas" "9" "1.5"] | |
;;[:app :lt.objs.app/set-default-zoom-level "-0.5"] | |
[:app :lt.objs.settings/pair-keymap-diffs] | |
[:editor :lt.objs.editor/no-wrap] | |
[:editor :lt.objs.editor/line-numbers true] | |
[:editor :lt.objs.editor/tab-settings false 2 2] |
This file contains 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
Show hidden characters
// installed Clojure packages: | |
// | |
// * BracketHighlighter | |
// * lispindent | |
// * SublimeREPL | |
// * sublime-paredit | |
{ | |
"word_separators": "/\\()\"',;!@$%^&|+=[]{}`~?", | |
"paredit_enabled": true, |
This file contains 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
(defn mod35 [number] | |
(or | |
(zero? (mod number 3)) | |
(zero? (mod number 5)))) | |
(reduce + (filter mod35 (range 1 1000))) |