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
license: gpl-3.0 |
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 *default-fetch-size* 500) | |
(defn with-query-results-cursor [[sql & params :as sql-params] func] | |
(sql/transaction | |
(with-open [stmt (.prepareStatement (sql/connection) sql)] | |
(doseq [[index value] (map vector (iterate inc 1) params)] | |
(.setObject stmt index value)) | |
(.setFetchSize stmt *default-fetch-size*) | |
(with-open [rset (.executeQuery stmt)] | |
(func (resultset-seq rset)))))) |
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
<html> | |
<head> | |
<title>Testing d3.js in Leaflet.js</title> | |
<link rel="stylesheet" href="leaflet.css" /> | |
<script type="text/javascript" src="http://d3js.org/d3.v2.min.js?2.9.3"></script> | |
<script src="http://code.leafletjs.com/leaflet-0.3.1/leaflet.js"></script> | |
<style type="text/css"> |
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
(defmacro fi | |
[interface args & code] | |
(let [interface-type (.getMapping *ns* interface) | |
methods (-> (.getMethods interface-type) | |
seq) | |
method-sym (.getName (first methods))] | |
(when-not (= (count methods) 1) |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"> | |
<meta name="apple-mobile-web-app-capable" content="yes"> | |
<title>D3.js and Openlayers - US States</title> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/openlayers/2.13.1/theme/default/style.css" type="text/css"> | |
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.0/themes/blitzer/jquery-ui.css" type="text/css"> | |
<script src="http://d3js.org/d3.v2.min.js?2.9.3"></script> |
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 package.classnamere) | |
(:import java.sql.Types) | |
(def db {:classname "oracle.jdbc.driver.OracleDriver" | |
:.... | |
:password (System/getenv "password")}) | |
(defn prepared-statement " on oracle stored procedure " [] | |
(jdbc/with-connection db | |
(with-open [stmt (.prepareCall (jdbc/connection) "{ call PACKAGE.PROCEDURE(?, ?) }")] |
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
var CubicBezier = function(canvas, opts){ | |
if(!opts) opts = {}; | |
this.start = opts.start || new Vec2(100,100); | |
this.end = opts.end || new Vec2(400, 400); | |
this.c1 = opts.c1 || new Vec2(100, 300); | |
this.c2 = opts.c2 || new Vec2(300, 100); | |
this.curve = new fabric.Path( this.toSVGPath() ); |
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
SELECT id,state,command,time,left(replace(info,'\n','<lf>'),120) | |
FROM information_schema.processlist | |
WHERE command <> 'Sleep' | |
AND info NOT LIKE '%PROCESSLIST%' | |
ORDER BY time DESC LIMIT 50; |
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
server { | |
listen 80; | |
listen 443 default_server ssl; | |
ssl on; | |
ssl_certificate /etc/ssl/certs/myssl.crt; | |
ssl_certificate_key /etc/ssl/private/myssl.key; | |
server_name *.example.com; | |
root /var/www/vhosts/website; |
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 socket = new Socket('localhost', 5000) | |
socket.withStreams { input, output -> | |
println input.newReader().readLine() | |
output << 'Imma socket' | |
} |
OlderNewer