Skip to content

Instantly share code, notes, and snippets.

View outofcoffee's full-sized avatar

Pete Cornish outofcoffee

View GitHub Profile
Edit your $GROOVY_HOME/conf/groovy-start.conf and add the following line:
load !{user.home}/.groovy/grapes/**.jar
After that your @Grab will work as advertised:
#!/usr/bin/env groovy
@Grab(group='mysql', module='mysql-connector-java', version='5.1.12')
import groovy.sql.Sql
@djacobs
djacobs / automatedBuildAndUploadToTestflight.sh
Created April 18, 2012 04:20 — forked from amattn/automatedBuildAndUploadToTestflight.sh
Automated Xcode build and upload to TestFlight.
#!/bin/sh
# Current as working as of 2012/4/17
# Xcode 4.3.2
PROJECT_ROOT="$HOME/SomeDirWhereYourProjectLives/XXXXXXXX"
WORKSPACE="$PROJECT_ROOT/XXXXXXXX.xcodeproj/project.xcworkspace"
CONFIG="AdHoc"
SCHEME="XXXXXXXX"
@cjwfuller
cjwfuller / gist:4169889
Created November 29, 2012 15:42
Logstash on Centos 6.3 (with GUI)

Logstash on Centos 6.3

Web GUI and Logstash agent on single server

Download logstash:

wget https://logstash.objects.dreamhost.com/release/logstash-1.1.5-monolithic.jar
@lehnerpat
lehnerpat / gh-compare.md
Last active September 3, 2022 04:33
GitHub Compare view

GitHub's compare view is available at:

https://github.com/$USER/$REPO/compare/$REV_A...$REV_B

Naturally, $USER and $REPO are the owner (user/organization) and repository names, respectively.

$REV{A,B} are the two sides of the compare view; they can either be a ref in $USER's repository, i.e. the name of a branch, tag or a commit SHA, or it can be a ref in $OWNER's fork of the repository by using the format $OWNER:$REF.

You can get a diff or patch for the result of the compare view by appending .diff or .patch to the URL, respectively.

@willurd
willurd / web-servers.md
Last active May 7, 2024 04:58
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@mattetti
mattetti / multipart_upload.go
Last active April 22, 2024 05:24
Example of doing a multipart upload in Go (golang)
package main
import (
"bytes"
"fmt"
"io"
"log"
"mime/multipart"
"net/http"
"os"
@duncandee
duncandee / RoboActionBarActivity.java
Created August 5, 2013 05:50
RoboActionBarActivity for AppCompact.
public class RoboActionBarActivity extends ActionBarActivity implements RoboContext {
protected EventManager eventManager;
protected HashMap<Key<?>, Object> scopedObjects = new HashMap<Key<?>, Object>();
@Inject
ContentViewListener ignored; // BUG find a better place to put this
@Override
protected void onCreate(Bundle savedInstanceState) {
@JonasGroeger
JonasGroeger / build.gradle
Last active January 23, 2024 07:55
Gradle: Read git commit hash.
def getCheckedOutGitCommitHash() {
def gitFolder = "$projectDir/.git/"
def takeFromHash = 12
/*
* '.git/HEAD' contains either
* in case of detached head: the currently checked out commit hash
* otherwise: a reference to a file containing the current commit hash
*/
def head = new File(gitFolder + "HEAD").text.split(":") // .git/HEAD
def isCommit = head.length == 1 // e5a7c79edabbf7dd39888442df081b1c9d8e88fd
@nschwermann
nschwermann / mobile-AndroidManifest.xml
Created June 30, 2014 02:58
Android Wearable Message API example
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="schwiz.net.weartest" >
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
@micw
micw / install_jenkins_plugin.sh
Last active August 11, 2023 06:14
Script to install one or more jenkins plugins including dependencies while jenkins is offline
#!/bin/bash
set -e
if [ $# -eq 0 ]; then
echo "USAGE: $0 plugin1 plugin2 ..."
exit 1
fi
plugin_dir=/var/lib/jenkins/plugins