Skip to content

Instantly share code, notes, and snippets.

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
@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')
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 / 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.

@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 ""}))
(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 / 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.
@neotyk
neotyk / web-socket-sample.clj
Created May 21, 2012 09:18
WebSocket with http.async.client sample
(require '[http.async.client :as http])
;; create clients
(def client (http/create-client))
;; websocket
(let [latch (promise)
ws (http/websocket
client "ws://localhost:8108/socket"
;; text message callback
@neotyk
neotyk / test_compare.js
Created May 17, 2012 19:32
cljs compare, 1000 data size
function e(a){throw a;}var f=void 0,k=!0,l=null,m=!1;function aa(){return function(a){return a}}function n(a){return function(){return this[a]}}function o(a){return function(){return a}}var p;
function r(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function s(a){return a!==f}function ba(a){return"string"==typeof a}function ca(a){return"number"==typeof a}function da(a){return a[ea]||(a[ea]=++fa)}var ea="closure_uid_"+Math.floor(2147483648*Math.random()).toString(36)
@neotyk
neotyk / test_compare.js
Created May 16, 2012 22:48
cljs compare with special case for numbers, 100000 data size
function e(a){throw a;}var f=void 0,k=!0,l=null,m=!1;function aa(){return function(a){return a}}function n(a){return function(){return this[a]}}function o(a){return function(){return a}}var p;
function r(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function s(a){return a!==f}function ba(a){return"string"==typeof a}function ca(a){return"number"==typeof a}function da(a){return a[ea]||(a[ea]=++fa)}var ea="closure_uid_"+Math.floor(2147483648*Math.random()).toString(36)