Skip to content

Instantly share code, notes, and snippets.

View scompt's full-sized avatar
🎓

Edward Dale scompt

🎓
View GitHub Profile
+ (void) createPinWithClientId:(NSString *)clientId
imageURL:(NSURL *)imageURL
sourceURL:(NSURL *)sourceURL
description:(NSString *)descriptionText {
Pinterest *pinterest = [[Pinterest alloc] initWithClientId:clientId];
[pinterest createPinWithImageURL:imageURL sourceURL:sourceURL description:descriptionText];
}
@scompt
scompt / gist:5841542
Last active December 18, 2015 20:39
A code snippet to visualize the placement of cells in a UICollectionViewLayout. Stick it at the bottom of the layoutAttributesForElementsInRect: method and copy/paste the output in your terminal window and you'll something like this: http://i.imgur.com/X74mB0v.png.
NSMutableString *magick = [[NSMutableString alloc] init];
[magick appendString:@"xc:skyblue -fill white -stroke black "];
int minX = rect.origin.x;
int minY = rect.origin.y;
int maxX = rect.size.width;
int maxY = rect.size.height;
for (UICollectionViewLayoutAttributes *att in theLayoutAttributes) {
minX = MIN(minX, att.frame.origin.x);
minY = MIN(minY, att.frame.origin.y);

Keybase proof

I hereby claim:

  • I am scompt on github.
  • I am scompt (https://keybase.io/scompt) on keybase.
  • I have a public key whose fingerprint is 5226 89E9 DA1C 447A 0025 2EBB 1B77 22E3 CEDA A0E4

To claim this, I am signing this object:

#!/bin/bash
# Based on https://github.com/JFrogDev/project-examples/blob/master/bash-example/deploy-folder-by-checksum.sh
export repo_url=
export tgt_repo=
export user=
export pass=
export dir="$1"
@scompt
scompt / download_workouts.sh
Last active October 19, 2020 15:43
A script to download workouts and exercise alternatives. Prerequisites are GNU Parallel, cURL, and jq.
#!/bin/bash
USERNAME=d@t.com
PASSWORD=r
LANGUAGES="en fr it ja tr es pt de"
PATHS="v3/coach/workouts v2/coach/workouts v2/coach/exercise_alternatives"
echo "Logging in"
export ID_TOKEN=`curl --silent -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{
BEGIN MESSAGE.
CAKSbgxUhf3QiFZ dJA4GbG3itcu0SG bOfXQ9mV0NGuLHJ xFtIidtcBMGEn0L
V5EAZ6DFQhrzOV7 4Cyb5Du9RU4TCKq 6Xr2MZHgg6tEG3h nLD5gzyKChF84Om
F1HvPu0rbPErjNL SOBgJ4TKGG3tnjW gtf6QNNNBrPi0t5 EQvlVGvNWVSZaYs
rVTRkPE8LQYfyWV PuiImApXm0a7E6W rPkI621.
END MESSAGE.