Skip to content

Instantly share code, notes, and snippets.

@neotyk
neotyk / README
Created September 17, 2012 19:06
WebSocket based browser-connected REPL
This ClojureScript REPL is able to work in restrictive environment, like Chrome Extension.
Requirements:
- WebSocket :: to receive JavaScript forms and send results back,
- 'unsafe-eval' :: Content Security Policy needs to allow 'unsafe-eval' for script-src
Security warning: Do *not* use in production!
Tested on Chrome, might work on other HTML5 enabled browsers.
(ns riemann-config-test
(:use
midje.sweet
riemann.streams
riemann.client
riemann.email
riemann.sns
[riemann.time :only [unix-time linear-time once! every!]])
(:require
riemann.streams
@neotyk
neotyk / korma_for_update.clj
Created September 10, 2013 08:53
Hack to make Korma select for update
(ns korma-for-update
(:require [clojure.test :refer :all]
[korma.core :refer [entity-fields defentity select* as-sql exec-raw]]
[korma.db :refer (postgres defdb)]))
;; TODO: use your local db
(defdb local (postgres {:db "neotyk"
:user "neotyk"
:host "localhost"
:password ""}))
@neotyk
neotyk / Slide-into-view-from-right.markdown
Created December 9, 2013 10:17
A Pen by Hubert Iwaniuk.

Slide into view from right

On :hover next element slides into view. Sliding is done with CSS Transitions. Only JS used is to add remove classes on mouseenter and mouseleave.

A Pen by Hubert Iwaniuk on CodePen.

License.

diff --git api/src/test/java/org/asynchttpclient/async/RequestBuilderTest.java api/src/test/java/org/asynchttpclient/async/RequestBuilderTest.java
index 586b74a..a2ced7a 100644
--- api/src/test/java/org/asynchttpclient/async/RequestBuilderTest.java
+++ api/src/test/java/org/asynchttpclient/async/RequestBuilderTest.java
@@ -74,6 +74,16 @@ public class RequestBuilderTest {
}
@Test(groups = {"standalone", "default_provider"})
+ public void testAddQueryParameterReadRawUrl() throws UnsupportedEncodingException {
+ RequestBuilder rb = new RequestBuilder("GET", true).setUrl("http://example.com/path")
@neotyk
neotyk / bottle_with_auth.py
Last active August 29, 2015 13:56
Initialize New Relic before including bottle to avoid naming problem when bottle.auth_basic is used.
import newrelic.agent
newrelic.agent.initialize('newrelic.ini')
from bottle import route, run, template, app, auth_basic
@route('/public')
def public():
return 'something something'
@route('/hello/:name')
Local
Open recent -> Recent DBs from Local
error? -> Empty
Opened Local*
Recent DBs from Local
Open recent local db -> Try Local Db from Local?
Open recent remote db -> Try Remote Db from Local?
Dismiss -> Local