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
| (defprotocol Event | |
| (scheduled-time [this]) | |
| (execute [this])) | |
| (defn simulate [event] | |
| (synchronize-time (scheduled-time event)) | |
| (execute event)) | |
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
| (def conversions | |
| { :do-nothing #(do %) }) |
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
| # 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 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
| 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 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
| netstat -anp tcp | grep 8080 | |
| lsof -i :8080 | |
| kill -9 34334 |
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
| 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 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
| package com.topmonks.monkbox.engine; | |
| import org.junit.Assert; | |
| import org.junit.Test; | |
| import org.junit.runner.RunWith; | |
| import org.junit.runners.Parameterized; | |
| import java.util.Arrays; | |
| /** |
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
| [Štěpán]: Používám knihovnu peerjs, který řeši problémy s rozdíli implementace ff a chrome; | |
| a problém je, když se mi spojí 20 (víc jsem netestoval) prohlížečů, tak se to spojí, | |
| vše je connected, readu a super; všechny kontrolní proměnné webrtc (connected, closed, | |
| destroyed a ještě jeden tam je) všechno se tváří správně (tak jak by mělo), | |
| ale vždy (myšleno jako v 98% případů) se najde nějaká svoji dvojice prohlížečů (tj. spojení webrtc), | |
| mezi kterými žádné zprávy neprojdou (ale vše se opět tváří jako že ok) |
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 gdg-jihlava) | |
| ;1, 2, Fizz, 4, Buzz, Fizz, 7, 8, Fizz, Buzz, 11, Fizz, 13, 14, Fizz Buzz | |
| (defn fizz-buzz-number [number] | |
| (cond | |
| (= 0 (mod number 3) (mod number 5)) :fizz/buzz | |
| (= 0 (mod number 3)) :fizz | |
| (= 0 (mod number 5)) :buzz | |
| :else number)) |
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/sh | |
| # | |
| # The hook check if commit message include jira ticket number. | |
| # Example: | |
| # Message: Refactoring (WEBAPI-100) | |
| # | |
| # Script location: .git/hooks/commit-msg | |
| # | |
| test "" != "$(grep '\(WEBAPI-[0-9]\+\)' "$1")" || { | |
| echo >&2 "ERROR: Commit message is missing Jira issue number." |