Skip to content

Instantly share code, notes, and snippets.

View andyscott's full-sized avatar
🌲

Andy Scott andyscott

🌲
View GitHub Profile
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
@andyscott
andyscott / ParseFacebookUtils.podspec.json
Last active August 29, 2015 14:06
Hack to change FB version!
{
"name": "ParseFacebookUtils",
"version": "1.3.0",
"license": {
"type": "Commercial",
"text": "See https://www.parse.com/about/terms"
},
"homepage": "https://www.parse.com/",
"summary": "Parse is a complete technology stack to power your app's backend.",
"authors": "Parse",
@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) {
#!/usr/bin/env bash
# find path to most recently updated simulator log
LOG_PATH=`find ~/Library/Logs/CoreSimulator/*/system.log -type f -print0 | xargs -0 stat -f "%m %N" |
sort -rn | head -1 | cut -f2- -d" "`
green=`tput setaf 2`
reset=`tput sgr0`
# formatter
FORMAT () {
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) };