Skip to content

Instantly share code, notes, and snippets.

@jder
jder / gist:f0c25bac2db04dfd9879
Created September 28, 2014 14:57
keybase.md
### Keybase proof
I hereby claim:
* I am jder on github.
* I am jder (https://keybase.io/jder) on keybase.
* I have a public key whose fingerprint is C3A2 C936 3494 7BFE C1BA 4902 D4E1 B2AF AC6D 4399
To claim this, I am signing this object:
@jder
jder / Downscaling ALAssets
Last active March 20, 2018 06:51
A method for downscaling ALAssets
// For details, see http://mindsea.com/2012/12/18/downscaling-huge-alassets-without-fear-of-sigkill
#import <AssetsLibrary/AssetsLibrary.h>
#import <ImageIO/ImageIO.h>
// Helper methods for thumbnailForAsset:maxPixelSize:
static size_t getAssetBytesCallback(void *info, void *buffer, off_t position, size_t count) {
ALAssetRepresentation *rep = (__bridge id)info;
NSError *error = nil;
if [[ $TERM != "dumb" ]]
then
export PS1="\[\e[36m\]\u@\h: \[\e[34m\]\w\n\[\e[0m\]\$ "
else
export PS1="\u@\h: \w\n\$ "
fi
PS1='\103\072$(echo \w|sed s/\\\//\\\\\\\\/g)>'
#!/bin/bash
TARGET_DIRS="a
b
c"
SOURCE_DIR=src
for TARGET in $TARGET_DIRS; do
xargs -I % cp $SOURCE_DIR/% $TARGET/% <<EOF