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
// sample text box | |
var descriptionField = new UITextView (new RectangleF (0, 230, UIScreen.MainScreen.Bounds.Width, 100)){ | |
BackgroundColor = UIColor.White, | |
Text = " Description:", | |
TextColor = ViewHelpers.DarkGray, | |
Font = UIFont.FromName("Helvetica", 18f) | |
}; | |
// some work arounds for UITextView placeholders | |
var Placeholder = " Description:"; | |
descriptionField.ShouldBeginEditing = t => { |
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
// sample text box | |
var deedDescriptionField = new UITextView (new RectangleF (0, 230, UIScreen.MainScreen.Bounds.Width, 100)){ | |
BackgroundColor = UIColor.White, | |
Text = " Description:", | |
TextColor = ViewHelpers.DarkGray, | |
Font = UIFont.FromName("Helvetica", 18f) | |
}; | |
// change the return key to done | |
descriptionField.ReturnKeyType = UIReturnKeyType.Done; | |
// dismiss keyboard on done |
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
// sample text box | |
var descriptionField = new UITextView (new RectangleF (0, 230, UIScreen.MainScreen.Bounds.Width, 100)){ | |
BackgroundColor = UIColor.White, | |
Text = " Description:", | |
TextColor = ViewHelpers.DarkGray, | |
Font = UIFont.FromName("Helvetica", 18f) | |
}; | |
// validation | |
descriptionField.ShouldEndEditing = t => { | |
if (string.IsNullOrEmpty (descriptionField.Text)) { |
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
// sample text field | |
var titleField = new UITextField (new RectangleF (0, 160, UIScreen.MainScreen.Bounds.Width, 50)){ | |
BackgroundColor = UIColor.White, | |
TextColor = ViewHelpers.DarkGray, | |
Placeholder = "Title:" | |
}; | |
// validation | |
titleField.EditingDidEnd += (object sender, EventArgs e) => { | |
if ( ((UITextField)sender).Text.Length <= 0 ) { | |
InvokeOnMainThread ( () => { |
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
<?php | |
// Grab XML | |
$xml_file = "rsform.xml"; | |
// Load xml data. | |
$xml = file_get_contents($xml_file); | |
// Strip whitespace between xml tags | |
$xml = preg_replace('~\s*(<([^>]*)>[^<]*</\2>|<[^>]*>)\s*~','$1',$xml); | |
// Convert CDATA into xml nodes. | |
$xml = simplexml_load_string($xml,'SimpleXMLElement', LIBXML_NOCDATA); | |
// Make variables |
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
Console.WriteLine(Newtonsoft.Json.JsonConvert.SerializeObject( | |
someObject, Formatting.Indented)); |
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
function millisecondsToStr (milliseconds) { | |
// TIP: to find current time in milliseconds, use: | |
// var current_time_milliseconds = new Date().getTime(); | |
function numberEnding (number) { | |
return (number > 1) ? 's' : ''; | |
} | |
var temp = Math.floor(milliseconds / 1000); | |
var years = Math.floor(temp / 31536000); |
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
<!--[if lte IE 6]> | |
<div style="background-color:#FFFFCC;padding:15px;border:solid 1px #000000;margin-bottom:20px;"> | |
<h1 style="color:#000000;margin-bottom:10px;">Warning - Unsupported Browser</h1> | |
<p>You are using an outdated version of Internet Explorer that has security issues and does not support global web standards. To ensure you have a better user experience online, across all sites (that includes capitolsales.com), we recommend that you upgrade <a class="getie7" href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx" target="_blank">your version of Internet Explorer</a> or choose any of these <strong>other excellent browsers</strong>: <a href="http://www.opera.com/download/" target="_blank">Opera</a>, <a href="http://www.mozilla.com/firefox/" target="_blank">Firefox</a>, <a href="http://www.apple.com/safari/download/" target="_blank">Safari</a> or <a href="http://www.google.com/chrome" target="_blank">Chrome</a>. It's free!</p> | |
</div> | |
<![endif]--> |
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 python | |
""" Convert values between RGB hex codes and xterm-256 color codes. | |
Nice long listing of all 256 colors and their codes. Useful for | |
developing console color themes, or even script output schemes. | |
Resources: | |
* http://en.wikipedia.org/wiki/8-bit_color | |
* http://en.wikipedia.org/wiki/ANSI_escape_code |
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
# Locate the 'Info.plist' by right clicking app and 'Show Package Contents' | |
# Add this just before the closing of the `</dict>` tag near where you see | |
# something similar to `<string>MainMenu</string><key>NSPrincipalClass</key>` | |
<key>LSUIElement</key> | |
<true/> |
OlderNewer