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 untar | |
(:import (org.apache.commons.compress.archivers.tar TarArchiveInputStream) | |
(java.io File) | |
(java.io FileOutputStream) | |
(java.io FileInputStream))) | |
(defn untar-file | |
"untar file and save to location - preserving filenames" | |
[zipfile outdirpath] | |
(let [buffer (byte-array 1024) |
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
;; requires >= jdk 1.8 | |
(defn encode-base64 [to-encode] | |
(.encodeToString (java.util.Base64/getEncoder) (.getBytes to-encode))) |
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
;; requires >= jdk 1.8 | |
(defn decode-base64 [to-decode] | |
(String. (.decode (java.util.Base64/getDecoder) to-decode))) |
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
;;input [:app :env config-{}] | |
(defn download-archive | |
[app env | |
{:keys [build-number build-name workdir] | |
{:keys [base-url archive-api archive-type archive-input-regex user pass]} :artifactory | |
{{{:keys [regex]} app} env} :deploy}] | |
(write-stream {:in (io/input-stream | |
(get-archive-response-body | |
{:uname user |
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
//counts instances of words that start with EDRIVE. stripping ; or ) off the end | |
grep -re 'EDRIVE\.' * |sed -e 's/.* \(EDRIVE\.[^ \);]*\).*/\1/' |sort |uniq -c | |
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
#!/bin/bash | |
# function to wrap a command with logging that also returns | |
# the status code of the command | |
function run() { | |
echo "running $@" |& tee -a out.log | |
eval $@ > >(tee -a out.log) 2> >(tee -a out.log) | |
return $? | |
} |
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
alias lg="git log --color --pretty=format:'%C(auto)%h %Cred %<(10,trunc)%an %Creset%C(auto)%s %Cgreen(%cr,%ar) %Creset%C(auto)%d'" |
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
:%s/\(-\)\(\w\)/\u\2/g | |
:%s <- every line in file | |
/ | |
\(-\) <- match group of char "-" | |
\(\w\) <- match group of any char | |
/ | |
\u\2 <- uppercase group 2 | |
/ | |
g <- globally (all occurances per line) |
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
// https://github.com/arnaudbenard/redux-mock-store/issues/59#issuecomment-345741265 | |
//------------- the saga ---------------- | |
function* fetchSaga(action) { | |
try { | |
yield put({type: "FETCH_SUCCEEDED", data: "data"}); | |
} catch (e) { | |
yield put({type: "FETCH_FAILED", message: e.message}); | |
} | |
} |
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
# Set environment variables here so they are available globally to all apps | |
# (and Terminal), including those launched via Spotlight. | |
# | |
# After editing this file run the following command from the terminal to update | |
# environment variables globally without needing to reboot. | |
# NOTE: You will still need to restart the relevant application (including | |
# Terminal) to pick up the changes! | |
# grep -E "^setenv" /etc/launchd.conf | xargs -t -L 1 launchctl | |
# | |
# See http://www.digitaledgesw.com/node/31 |
OlderNewer