Skip to content

Instantly share code, notes, and snippets.

View andyscott's full-sized avatar
🌲

Andy Scott andyscott

🌲
View GitHub Profile
@andyscott
andyscott / drop-to-repl-2.9.RC1.scala
Created April 6, 2011 18:39 — forked from retronym/drop-to-repl-2.8.scala
Scala Drop to REPL (like debug break..)
/**
* Originally authored by Jason. Updated by me (Andy) to work in Scala 2.9 RC1
*
* @author Jason Zaugg (aka retronym), Andy Scott
*/
object InterpreterUtil {
import scala.tools.nsc.interpreter._
import scala.tools.nsc.interpreter.Results._
import scala.tools.nsc.Settings
@andyscott
andyscott / git-svn-diff
Created May 18, 2011 19:22
Generate SVN Diff patches from GIT
#!/bin/sh
#
# git-svn-diff
# Generate an SVN-compatible diff against the tip of the tracking branch
# I didn't write this and I don't know who did!
TRACKING_BRANCH=`git config --get svn-remote.svn.fetch | sed -e 's/.*:refs\/remotes\///'`
REV=`git svn find-rev $(git rev-list --date-order --max-count=1 $TRACKING_BRANCH)`
git diff --no-prefix $(git rev-list --date-order --max-count=1 $TRACKING_BRANCH) $* |
@andyscott
andyscott / StandardDialog.java.diff
Created May 25, 2011 17:01
Added names to buttons created via createOKCancelButtonPanel()
Index: src/com/jidesoft/dialog/StandardDialog.java
===================================================================
--- src/com/jidesoft/dialog/StandardDialog.java (revision 1760)
+++ src/com/jidesoft/dialog/StandardDialog.java (working copy)
@@ -31,6 +31,11 @@ import java.beans.PropertyChangeListener;
* createContentPanel()
*/
abstract public class StandardDialog extends JDialog implements ButtonNames {
+ /**
+ *
@andyscott
andyscott / blah.sh
Created May 26, 2011 14:31
WIP script for determining which repos are ahead/behind origin
#!/bin/sh
dg="\e[0;32m"
r="\e[1;31m"
b="\e[1;34m"
m="\e[1;35m"
cyan="\e[1;36m"
rs="\e[0m"
pdir=${PWD##*/}
@andyscott
andyscott / cleanup1.diff
Created May 27, 2011 18:32
Diff for cleanups on dialog and comparator packages
Index: src/com/jidesoft/comparator/AlphanumComparator.java
===================================================================
--- src/com/jidesoft/comparator/AlphanumComparator.java (revision 1765)
+++ src/com/jidesoft/comparator/AlphanumComparator.java (working copy)
@@ -61,7 +61,6 @@ public class AlphanumComparator implements Comparator<CharSequence> {
/**
* Length of string is passed in for improved efficiency (only need to calculate it once) *
*/
- @SuppressWarnings({"JavaDoc"})
private String getChunk(CharSequence s, int slength, int marker) {
import java.lang.reflect.Method;
public class SystemClassLoader {
private static final Method defineClassMethod;
public static Class<?> loadClass(String className, byte[] b) {
// override classDefine (as it is protected) and define the class.
Class<?> clazz = null;
try {
Object[] args = new Object[] { className, b, new Integer(0), new Integer(b.length) };
@andyscott
andyscott / circle.yml
Created May 22, 2013 01:23
circle.yml for sbt 0.12.3
machine:
timezone:
US/Pacific
## Customize checkout
checkout:
post:
- git submodule update --init # use submodules
dependencies:
@andyscott
andyscott / gist:6361691
Last active December 21, 2015 20:29
sequencing List[Future[A \/ B]]
type FutureEither[A, B] = EitherT[Future, A, B]
implicit class SequenceOverFutureEither[F[_], A, B](v: F[FutureEither[A, B]])(implicit F0: Traverse[F]) {
def sequenceR() = v.sequence[({ type λ[R] = FutureEither[A, R] })#λ, B]
}
trait Magnetic[T] {
protected sealed trait TagMag
type Magnet = T @@ TagMag
protected implicit def tag(value: T) = Tag[T, TagMag](value)
def apply(mag: Magnet): T = mag
}
object CreateDescriptor extends Magnetic[CreateDescriptor] {
implicit def default(unit: Unit): Magnet = CreateDescriptor(None, AssetDescriptorRecord())
implicit def fromUser(user: ProfilePair): Magnet = CreateDescriptor(Some(user), AssetDescriptorRecord())
before_deploy:
- mkdir deploy_staging
- cp */target/**/*.jar deploy_staging
deploy:
skip_cleanup: true
provider: s3
bucket: build-bucket
region: us-west-2
local-dir: deploy_staging