Skip to content

Instantly share code, notes, and snippets.

View aspnetde's full-sized avatar

Thomas Bandt aspnetde

View GitHub Profile
@aspnetde
aspnetde / BTProgressHUD_FailingTest
Last active December 19, 2015 03:59
Calling the Show()-Method within ViewDidLoad() works, it event works when calling it within the first tap-handler of the StringElement. But calling it in the click-handler of the alert view, it disappears.
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using MonoTouch.Dialog;
using BigTed;
namespace iOS.ProgressHUD.Demo
{
@aspnetde
aspnetde / node-bcrypt-password-creator.js
Created January 8, 2015 10:38
Node.js bcrypt password creator
var bcrypt = require("bcrypt");
var clearPassword = "test";
bcrypt.genSalt(10, function(err, salt) {
bcrypt.hash(clearPassword, salt, function(err, hash) {
bcrypt.compare(clearPassword, hash, function(err, res) {
if (res === true && !err) {
console.log("Hashed password: " + hash);
} else {
@aspnetde
aspnetde / .View
Last active September 28, 2021 10:11
Xamarin.iOS MemoryUtility
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.MessageUI;
using MonoTouch.UIKit;
namespace MyApp
{
public interface ICanCleanUpMyself
{

Keybase proof

I hereby claim:

  • I am aspnetde on github.
  • I am asp_net (https://keybase.io/asp_net) on keybase.
  • I have a public key whose fingerprint is 5E95 3A7E B10F E125 FC26 26CC 9F48 9E63 D6AD FAFB

To claim this, I am signing this object:

@aspnetde
aspnetde / upload-ipa-to-itunes-connect.sh
Created November 26, 2015 23:07
A small script that uses XCode's Application Loader to automatically submit an IPA to iTunes Connect
#!/bin/bash
set -ex
# Originally from https://gist.github.com/jedi4ever/b1f8b27d4a803d487fa4
# This scripts allows you to upload a binary to the iTunes Connect Store and do it for a specific app_id
# Because when you have multiple apps in status for download, xcodebuild upload will complain that multiple apps are in wait status
# Requires application loader to be installed
# See https://developer.apple.com/library/ios/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/Chapters/SubmittingTheApp.html
@aspnetde
aspnetde / PdfMerger.cs
Last active April 20, 2016 08:36
Merge Pdfs on the fly with Xamarin.iOS
public class PdfMerger
{
private readonly IFileSystemUtility _fileSystem;
public PdfMerger(IFileSystemUtility fileSystem)
{
_fileSystem = fileSystem;
}
public string Merge(params string[] paths)
@aspnetde
aspnetde / gist:511c72e743fb658f71f186df12fca85d
Last active October 2, 2016 21:24
Der perfekte Workflow für Pull-Requests (als Werkzeug für Code-Reviews)?
Pull-Requests funktionieren wunderbar für kleinere Sachen: Bugfixes, kleinere Features.
Alles, wo die Anzahl der Changes überschaubar bleibt und sich ein Review in kurzer Zeit
gut bewerkstelligen lässt. Siehe: http://blog.ploeh.dk/2015/01/15/10-tips-for-better-pull-requests/
Die Frage ist, wie man das bei größeren Features organisiert.
Angenommen ein Entwickler bekommt die Aufgabe, ein komplett neues Modul in einer App
zu bauen. Bricht man die Aufgabe – was für die Reviews wichtig ist – in kleine
Einheiten auf, hilft das sicherlich auch schon mal allgemein bei der Strukturierung.
@aspnetde
aspnetde / fake-failing-test.fsx
Created October 6, 2016 15:02
FAKE Failing Test (with PlistBuddy)
#r "tools/FAKE/FakeLib.dll"
open Fake
open System
open System.IO
let Exec command args =
let result = Shell.Exec(command, args)
if result <> 0 then failwithf "%s exited with error %d" command result
[<Test>]
let ``Die Backtick-Syntax ist eigentlich ganz cool, wenn man sich mal daran gewöhnt hat.``() =
Assert.IsTrue(true)
@aspnetde
aspnetde / DroidTlsClientHandler.cs
Created January 17, 2017 14:32
An AndroidClientHandler implementation supporting Certificate Pinning
using System.IO;
using Java.Security;
using Java.Security.Cert;
using Javax.Net.Ssl;
using Xamarin.Android.Net;
namespace NeunundsechzigGrad.Foo
{
public class DroidTlsClientHandler : AndroidClientHandler
{