Skip to content

Instantly share code, notes, and snippets.

@SlevinBE
SlevinBE / iTerm2-Multi-SSH.scpt
Last active February 5, 2016 14:28
SSHs to a set of servers and executes a certain command once logged in
on run argv
-- How to execute:
-- osascript iTerm2-Multi-SSH.scpt development.mycluster htop
-- accepts two arguments:
-- 1. common part of the server names. eg. development.mycluster
-- 2. the command to execute once logged into the servers
set findhostnames to "less ~/.ssh/config | sed -n \"s|^Host \\(" & item 1 of argv & ".*\\)|\\1|gp\" | sed \"s/,$//g\""
set serverList to paragraphs of (do shell script findhostnames)
@SlevinBE
SlevinBE / sheet-fzf.bash
Created July 27, 2015 11:35
Bash script with some integration commands between sheet (a shell bookmarking lib) and fzf (a fuzzy search command lib). Written for OSX
# find a sheet and show its content
sheetf() {
SHEET_NAME=$(sheet | fzf)
sheet $SHEET_NAME
}
#find a sheet and copy it's contents onto the clipboard
sheetfc() {
SHEET_NAME=$(sheet | fzf)
sheet $SHEET_NAME | pbcopy
//load all relevant meetings with their attendees
meetings
.leftJoin(attendeeLinks).on { case (meeting, attendeeLink) =>
meeting.id === attendeeLink.meetingId
}
.leftJoin(users).on { case ((meeting, attendeeLink), user) =>
attendeeLink.userId === user.id
}
.where { case ((meeting, attendeeLink), user) =>
meeting.id in meetingIds
@SlevinBE
SlevinBE / slick-optional-loading
Created July 30, 2014 06:04
Slick BlogPostModel with optionally loaded author
object BlogPostModel {
case class BlogPost (
id: Option[Long] = None,
title: String,
author_id: Long,
postedDate: LocalDate,
summary: String,
content: String,
published: Boolean) {
@SlevinBE
SlevinBE / vimrc-tweaked
Created April 25, 2014 09:37
vimrc tweaked
" ----------- Vundle Package manager config --------
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
@SlevinBE
SlevinBE / pom.xml
Created October 30, 2013 14:48
Based on Jeremy's Gradle task (see https://gist.github.com/jeremyjarrell/6083207), but in pure Groovy. Can be integrated into a Maven build.
<plugin>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>groovy-maven-plugin</artifactId>
<version>2.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>execute</goal>
</goals>
@SlevinBE
SlevinBE / gist:3755086
Created September 20, 2012 10:20
Gradle url-based dependencies
repositories {
add(new org.apache.ivy.plugins.resolver.URLResolver()) {
name = 'Apache'
addArtifactPattern 'http://apache.cu.be/incubator/flex/4.8.0-incubating/binaries/[module]-[revision]-incubating-bin.[ext]'
}
}
dependencies {
merged group: 'org.apache', name: 'apache-flex-sdk', version: '4.8.0', ext: 'zip'
}