Skip to content

Instantly share code, notes, and snippets.

View calebphillips's full-sized avatar

Caleb Phillips calebphillips

View GitHub Profile
@calebphillips
calebphillips / MySQL_5-7_macOS.md
Created August 7, 2019 19:43 — forked from robhrt7/MySQL_5-7_macOS.md
Install MySQL 5.7 on macOS using Homebrew

This is a fork of original gist https://gist.github.com/nrollr/3f57fc15ded7dddddcc4e82fe137b58e, with slight changes on pointing to 5.7 version branch, instead of 8 (latest default of MySQL in Hombrew).

Install MySQL 5.7 on macOS

This procedure explains how to install MySQL using Homebrew on macOS (Sierra 10.12 and up)

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.
(require '[clojure.string :as str])
(import [java.time Month LocalDateTime YearMonth])
(defn left-pad [desired-width s]
(let [padding (apply str (repeat (- desired-width
(count (str s)))
" "))]
(str padding s)))
(defn right-pad [desired-width s]
#!/bin/sh
pat='.marvel-2015.04.29'
idxs=`curl -s localhost:9200/_cat/indices/${pat}\?h=index | sort`
single=`echo $idxs | tail -1`
id=`echo $pat | sed 's/[^a-zA-Z]*//g'`-`date -u +%s`
d=/tmp/$id
if [ -d $d ]; then
echo $d exists, delete and rerun $0
(require '[clojure.string :as str])
(def turns
{:L {:N :W
:W :S
:S :E
:E :N}
:R {:N :E
:E :S
:S :W
(defn nodes-in-group
"Build a list of nodes in a given security-group"
[security-group]
(filter #(= (% 0) security-group)
(map #(vector (pallet.compute/group-name %)
(pallet.compute/primary-ip %)
(pallet.compute/id %)
(pallet.compute.jclouds/node-locations %) )
(pallet.compute/nodes srvc))))
(ns pallet-test.core
(:use
[clojure.contrib.command-line])
(:require
[pallet.core :as core]
[pallet.compute :as compute]
[pallet.phase :as phase]
[pallet.crate.java :as java]
[pallet.crate.automated-admin-user :as automated-admin-user]))
(ns nouns
(:require [clojure.java.io :as io]
[clojure.data.generators :as gen]
[datomic.api :as d])
(:import [java.io PushbackReader]))
;; Knobs
(def transaction-size 1000)
(def transaction-count (atom 0))
(def document-count 200000)
;; Find a random even number less than 100
;; Standard nested lisp form
(rand-nth (filter even? (range 100)))
;; With threading macro http://clojuredocs.org/clojure_core/clojure.core/-%3E%3E
(->> (range 100)
(filter even?)
rand-nth)
@calebphillips
calebphillips / spec_helper.rb
Created July 18, 2012 19:44 — forked from sethbro/spec_helper.rb
Rails unit, functional and integration tests in Minitest spec format.
ENV["RAILS_ENV"] = "test"
require File.expand_path('../../config/environment', __FILE__)
require 'rubygems'
gem 'minitest'
require 'minitest/autorun'
require 'action_controller/test_case'
require 'miniskirt'
require 'capybara/rails'
require 'benchmark'
class ActionController::TestCase
alias __old_process__ process
def process(*args)
max_time = 0.2
time = Benchmark.realtime { __old_process__(*args) }
assert time < max_time, exceeded_run_time(time, max_time)
end