Skip to content

Instantly share code, notes, and snippets.

Test
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://tempuri.org/">
<soap:Body xmlns:a="http://schemas.datacontract.org/2004/07/WebServices.DataContract" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<SaveQualityInspections>
<qualityInspections>
<a:QualityInspections>
<a:QualityInspection>
<a:Answers>
<a:QualityInspectionAnswer>
<a:QuestionId>b505bbc0-c9d3-4f28-ab43-d12a498a229d</a:QuestionId>
@blork
blork / gist:4344713
Created December 20, 2012 11:11
Gmail Modal
//On presenting the modal...
UIImageView *backView = [[UIImageView alloc] initWithImage:[self.navigationController.view screenshot]];
[backView setTag:1338];
[self.navigationController.view addSubview:backView];
UIView *maskView = [[UIView alloc] initWithFrame:self.navigationController.view.frame];
[maskView setBackgroundColor:[UIColor blackColor]];
[maskView setTag:1337];
[self.navigationController.view addSubview:maskView];
@blork
blork / Pinner 1.1-beta1.md
Last active December 12, 2015 09:19
Pinner 1.1-beta1 change log

Pinner 1.1-beta1

Change log:

  • Removed old info button.
  • Moved 'extended' text to pullable drawer.
  • Hide toolbar/navigation on scroll, instead of fullscreen mode.
  • Only sets description on a new bookmark if contents of pasteboard are new.
  • Can now edit from detail page.
  • Better tag matching.
  • New app icon.
@blork
blork / git-changelog.sh
Last active December 15, 2015 15:19
A shell script which generates a nicely formatted change log between two git commit hashes. To be added as a custom action in Sourcetree.
#! /bin/bash
git log $1...$2 --pretty=format:'• %s' --reverse | grep -v Merge
@blork
blork / StackIntentService.java
Last active December 15, 2015 19:29 — forked from SeanPONeil/BlockingIntentService.java
Works as IntentService, based on code from AOSP. Adds intents to a LIFO stack, executes most recently added first. onHandleIntent returns boolean indicating whether the intent has already been added.
package com.threesquared.axawellbeing.web.services;
import android.app.Service;
import android.content.Intent;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.IBinder;
import android.os.Looper;
import android.os.Message;
@blork
blork / isIntentAvailable.java
Created May 21, 2013 13:54
Check if an intent is available.
public static boolean isIntentAvailable(Context context, Intent intent) {
final PackageManager packageManager = context.getPackageManager();
List<ResolveInfo> resolveInfo = packageManager.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
if (resolveInfo.size() > 0) {
return true;
}
return false;
}
@blork
blork / dp2px.java
Created May 21, 2013 14:49
Convert DP (display independent pixels) to pixels.
public static int dp2px(final float dps, final Resources res) {
final float scale = res.getDisplayMetrics().density;
final int pixels = (int) ((dps * scale) + 0.5f);
return pixels;
}
/*
* TypefaceTextView.java
* Simple
*
* Copyright 2012 Simple Finance Corporation (https://www.simple.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
+ (void) insertOrUpdate:(NSArray*)dictArray
forUniqueKey:(NSString*)key
withBlock:(void (^) (NSDictionary* dictionary, NSManagedObject* object))block
inStore:(Store *) store
error:(NSError*)error
{
NSManagedObjectContext* context = [store privateContext];
__block NSError *localError = nil;
[context performBlockAndWait:^{