This file contains hidden or 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
static bool IsPalin(string s) | |
{ | |
var bi = s.Length - 1; | |
foreach (var r in s.EnumerateRunes()) | |
{ | |
if (!Rune.TryGetRuneAt(s, bi - (r.Utf16SequenceLength - 1), out var b) || !r.Equals(b)) | |
{ | |
return false; | |
} |
This file contains hidden or 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
// | |
// Copyright (c) 2013-2015 Frank A. Krueger | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: | |
// |
This file contains hidden or 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 ruby | |
device_types_output = `xcrun simctl list devicetypes` | |
device_types = device_types_output.scan /(.*) \((.*)\)/ | |
runtimes_output = `xcrun simctl list runtimes` | |
runtimes = runtimes_output.scan /(.*) \(.*\) \((com.apple[^)]+)\)$/ | |
devices_output = `xcrun simctl list devices` | |
devices = devices_output.scan /\s\s\s\s(.*) \(([^)]+)\) (.*)/ |
This file contains hidden or 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
-> CopyPNGFile | |
Copies a .png file resource, optionally compressing it. | |
$ copypng [options] $(IPHONE_OPTIMIZE_OPTIONS) [input] [output] | |
-> Code Sign | |
Code-sign a framework, application, or other built target. | |
$ /usr/bin/codesign | |
-> Strip Symbols | |
Remove or modify the symbol table of a Mach-O binary |
This file contains hidden or 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 | |
# | |
# simple recursive search and replace string in files | |
# setup: alias replace='~/replace.sh' | |
# notes: you will need to escape special chars! eg: replace '\/dir1' '\/dir2' . | |
# usage: replace <oldstring> <newstring> <path> <depth> | |
# examples: | |
# replace "([^\s]+.php)" "\/\1" . | |
# replace "\"\/([^\/]+.php)" "\"\/dir\/\1" . |
This file contains hidden or 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
using System; | |
using MonoTouch.Foundation; | |
using MonoTouch.UIKit; | |
using MonoTouch.Dialog; | |
using System.IO; | |
using MonoTouch.MessageUI; | |
using System.Threading; | |
using MonoTouch.ObjCRuntime; | |
using System.Globalization; | |
using System.Xml.Linq; |
This file contains hidden or 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
/// <summary> | |
/// Sets the anchor point and translates the view so that it stays in its current position. | |
/// Normally, changing the anchor point also adjusts the view's position. | |
/// </summary> | |
/// <param name='oView'>the view whose anchor point has to be modified</param> | |
/// <param name='oNewAnchorPoint'>the new anchor point</param> | |
public void SetAnchorPointAndTranslate(PointF oNewAnchorPoint ) | |
{ | |
UIView oView = this; | |
PointF oNewPoint = new PointF(oView.Bounds.Width * oNewAnchorPoint.X, oView.Bounds.Height * oNewAnchorPoint.Y); |
This file contains hidden or 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
public class BTPinchGestureRecognizer : UIPinchGestureRecognizer | |
{ | |
public BTPinchGestureRecognizer(NSObject target, Selector action) : base(target, action) | |
{ | |
ShouldReceiveTouch += (sender, touch) => { | |
//if (touch.View is UISlider || touch.View is MPVolumeView) return false; | |
return true; | |
}; | |
This file contains hidden or 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
//most of the non-declared variables here are at the class level - eg window is: | |
// UIWindow window | |
// etc. | |
window = new UIWindow (UIScreen.MainScreen.Bounds); | |
UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.BlackOpaque; | |
NewerOlder