π΄
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 performance.server | |
"The routes for the web server." | |
(:require [cheshire.core :as json] | |
[clj-time.core :refer [now]] | |
[clojure.tools.logging :refer [infof warn warnf error errorf]] | |
[compojure | |
[core :refer [defroutes GET POST]] | |
[handler :as handler]] | |
[ring.middleware.jsonp :refer [wrap-json-with-padding]] | |
[ring.middleware.params :refer [wrap-params]] |
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
(into {} | |
(map (fn [a] | |
(let [ [ x y ] a ] | |
[ (keyword x) y ])) c)) |
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 foo.bar | |
(:require [cheshire.core :as json] | |
[clojure.java.jdbc :as jdbc]) | |
(:import [org.postgresql.util PGobject])) | |
(defn extend-db-driver [] | |
(extend-type org.postgresql.util.PGobject | |
jdbc/IResultSetReadColumn |
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 something.core | |
(:require [something.message-bus :as message-bus])) | |
; handler simply gets a hashmap, from the JSON payload | |
; Responses are modeled after jondot/sneakers | |
; :ack - acks | |
; :reject - rejects message, it will be retiried | |
; :reject-requeue - rejects and requeues straight away (dangerous!) | |
(defn handler-fn [payload] | |
(let [m (:m payload)] |
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
es_alias = ENV.fetch('ALIAS') | |
hosts = ENV.fetch('HOSTS') | |
old_index = ENV.fetch('OLD_INDEX') | |
old_type = ENV.fetch('OLD_TYPE') | |
new_index = ENV.fetch('NEW_INDEX') | |
new_type = ENV.fetch('NEW_TYPE') | |
size = ENV.fetch('SCAN_SIZE', 100) | |
client = Elasticsearch::Client.new(hosts: hosts) | |
unless client.indices.exists(index: new_index) |
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
var template = "{{#awesomize}}{{word}}{{/awesomize}}"; | |
var helpers = { | |
awesomize: function() { | |
return function(text,render) { | |
return "<blink>"+render(text)+"</blink>"; | |
} | |
} | |
} |
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
require 'socket' | |
child_socket, parent_socket = Socket.pair(:UNIX, :DGRAM, 0) | |
maxlen = 1000 | |
fork do | |
parent_socket.close | |
child_socket.send("PID: #{$PROCESS_ID}", 0) | |
sleep 10 |
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
#!/usr/bin/env bash | |
# Before using: | |
# export RABBIT_USER=<user> | |
# export RABBIT_PASSWORD=<password> | |
# export RABBIT_VHOST=<vhost, most likely / or /main> | |
pw=$RABBIT_PASSWORD | |
lo=$RABBIT_USER | |
vh=$RABBIT_VHOST |
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
$ ind app -name *.rb -exec wc -l {} \; | awk '{ print $1 }'| spark | |
ββββββ ββββββββ ββββββββββββββββββββββββ ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ ββ βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ βββββββββββββ ββββββββββββ |
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
// Hover.com "Zone file import/export" has been *Planned* since 2011 | |
// https://help.hover.com/entries/471066-Zone-file-import-export | |
// Here's a brittle approximation of export. | |
// | |
// 1. login to your account: https://www.hover.com/domains | |
// 2. run the following in your browser's JavaScript console, changing the first line | |
// to your domain | |
// 3. copy the text logged to the console. | |
// 4. manually correct FQDNs, these have to end with a period "." | |
// |