This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
@interface NSString (Templating) | |
+(NSString*)stringWithTemplate:(NSString*)tpl | |
fromMap:(NSDictionary*)map; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Cocoa/Cocoa.h> | |
@interface KSImageView : NSImageView | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Photoshop Script to Create iPhone Icons from iTunesArtwork | |
// | |
// WARNING!!! In the rare case that there are name collisions, this script will | |
// overwrite (delete permanently) files in the same folder in which the selected | |
// iTunesArtwork file is located. Therefore, to be safe, before running the | |
// script, it's best to make sure the selected iTuensArtwork file is the only | |
// file in its containing folder. | |
// | |
// Copyright (c) 2010 Matt Di Pasquale | |
// Added tweaks Copyright (c) 2012 by Josh Jones http://www.appsbynight.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <UIKit/UIKit.h> | |
@interface DateFlowLayout : UICollectionViewFlowLayout | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function () { | |
/* zoom the image if it is not yet zoomed */ | |
if (jQuery("#s3img").length == 0) { | |
jQuery("#ZoomImage").click(); | |
jQuery("#ZoomImage").click(); | |
jQuery("#ZoomImage").click(); | |
} | |
/* Either open the image in a new window or */ | |
if (confirm("Open image in new window? (you might get 'access forbidden')")) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
@interface KSTimingHelper : NSObject | |
// Thanks to Mattt Thompson -> http://nshipster.com/benchmarking/ | |
extern uint64_t dispatch_benchmark(size_t count, void (^block)(void)); | |
+(unsigned long long)timeForBlock:(void (^)(void))actions; | |
+(unsigned long long)timeForBlock:(void (^)(void))actions runCount:(NSUInteger)runCount; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# Interpolate GPX waypoints to slow a simulated route down. | |
import itertools | |
import sys | |
import xml.etree.ElementTree as ET | |
def pairwise(iterable): | |
"s -> (s0,s1), (s1,s2), (s2, s3), ..." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: | |
/** | |
* Structr-UI Helpers - a couple of simple functions to send REST requests to Structr. | |
* Calls to Structr automatically get the header flag 'Structr-Websocket-Broadcast' set to 'disabled' so that | |
* performance does not suffer too much when doing larger tasks. | |
*/ | |
function structr_rest(method, path, data, callback) { | |
var allow = true; | |
if (!method || method == '') { | |
allow = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
backup_structr() { | |
[ ! -d files ] || [ ! -d db ] && echo "db and files must be present. not in structr-ui folder?" && return 1 | |
local OPT="" | |
[ ! -z $1 ] && OPT="-"$1 && OPT=${OPT//[^a-zA-Z0-9-_]/} | |
local BAKFILE=db-files-$(date +%Y%m%d-%H%M%S)$OPT.tar.bz2 | |
echo "backing up to "$BAKFILE | |
tar cvfj $BAKFILE db files | |
} | |
cdstructr() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
target_osx=$(sw_vers -productVersion) | |
project_dir=/Users/rkmax/development/aseprite | |
skia_dir=/Users/rkmax/development/skia | |
arch="$(uname -m)" | |
bundle_trial_url=https://www.aseprite.org/downloads/trial/Aseprite-v1.2.40-trial-macOS.dmg |