Skip to content

Instantly share code, notes, and snippets.

View lukemayes's full-sized avatar

Luke Mayes lukemayes

  • Expedia
  • Springfield, MO
View GitHub Profile
@jarek-przygodzki
jarek-przygodzki / truncFile.groovy
Created December 6, 2012 21:24
Truncate a file
import java.nio.channels.*
def truncFile(File file, long newSize) {
FileChannel fileChannel;
try {
fileChannel = new FileOutputStream(file, true).getChannel();
fileChannel.truncate(newSize);
} finally {
fileChannel?.close()
}
@jordelver
jordelver / gist:3139365
Created July 18, 2012 22:29
How to write an image file to an SD card under Mac OS X (for Raspberry Pi)

Find the SD card device

In this case, the SD card is /dev/disk4. DO NOT get this wrong or you may destroy all the data on the wrong disk/card/drive.

diskutil list

/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *160.0 GB   disk0

1: EFI 209.7 MB disk0s1

@haschek
haschek / .jshintrc
Created May 4, 2012 16:08
JSHint Configuration, Strict Edition
{
// --------------------------------------------------------------------
// JSHint Configuration, Strict Edition
// --------------------------------------------------------------------
//
// This is a options template for [JSHint][1], using [JSHint example][2]
// and [Ory Band's example][3] as basis and setting config values to
// be most strict:
//
// * set all enforcing options to true