Skip to content

Instantly share code, notes, and snippets.

View jeffscottbrown's full-sized avatar

Jeff Scott Brown jeffscottbrown

View GitHub Profile
~ $ cat toms.groovy
interface PRINT {
def LN = '\n\n'
def BREAK = '='*80
}
println PRINT.BREAK
~ $ groovy toms.groovy
================================================================================
void "Deleting a valid file from an existent part" (){
given:
List <Metafile> sampleMetafiles = [new Metafile(id: '1111111111', filename: 'test.pdf', title: '',
description: '', uploadedOn: new Date(),
partId: '2222222222', uploadedBy: 'Alfred', userId: '333333333'),
new Metafile(id: '1111111112', filename: 'test2.pdf', title: '',
description: '', uploadedOn: new Date(),
partId: '2222222221', uploadedBy: 'Alfred', userId: '333333334')
]
// I don't think there are scenarios where this is the best thing to do...
def donors = Donor.createCriteria().list(){
eq('event', event)
}
if(params.sort == "firstName"){
if(params.order == "asc"){
donors.sort {it.firstName}
} else {
~ $ git clone [email protected]:jeffbrown/zaidkhandomaintest.git
Cloning into 'zaidkhandomaintest'...
remote: Enumerating objects: 111, done.
remote: Counting objects: 100% (111/111), done.
remote: Compressing objects: 100% (86/86), done.
remote: Total 111 (delta 11), reused 111 (delta 11), pack-reused 0
Receiving objects: 100% (111/111), 627.88 KiB | 3.09 MiB/s, done.
Resolving deltas: 100% (11/11), done.
~ $
~ $
~ $ mn create-app someapp
| Application created at /Users/jeffscottbrown/someapp
~ $
~ $ cd someapp
someapp $
someapp $ mn --help
Usage: mn [-hvVx] [COMMAND]
Micronaut CLI command line interface for generating projects and services.
Application generation commands are:
public void subscribeToMqtt(Message message) {
executor.cppMethod();
}
public class TestExecutor {
static {
System.loadLibrary("native");
}
public native String cppMethod();
}
name: Publish To GCR
on:
push:
tags:
- 'v*'
env:
GCLOUD_REGION: ${{ secrets.GCLOUD_REGION }}
PROJECT_ORGANIZATION: ${{ secrets.PROJECT_ORGANIZATION }}
DOCKER_IMAGE: ${{ secrets.DOCKER_REGISTRY_URL }}
jobs:
// This is a bad idea
File f = File.createTempFile("temp", Long.toString(System.nanoTime()));
System.setErr(new PrintStream(new FileOutputStream(f)) {
@Override
public void println(String x) {
throw new RuntimeException(x);
}
});
System.err.println("overflow!");
~ $ git clone [email protected]:jeffbrown/stevemaystermkdir.git
Cloning into 'stevemaystermkdir'...
remote: Enumerating objects: 23, done.
remote: Counting objects: 100% (23/23), done.
remote: Compressing objects: 100% (17/17), done.
remote: Total 23 (delta 0), reused 23 (delta 0), pack-reused 0
Receiving objects: 100% (23/23), 60.03 KiB | 543.00 KiB/s, done.
~ $
~ $
~ $ cd stevemaystermkdir
~ $ pwd
/Users/jeffscottbrown
~ $
~ $ ls stevemayster
~ $
~ $ cat stevewantstocreatedirectory.groovy
def nametest = 'try'
def patchPath = '/Users/jeffscottbrown/stevemayster'
def fileName = "${patchPath}/${nametest}"