Skip to content

Instantly share code, notes, and snippets.

View gist:833a811fca4dd613d121
System.Console.WriteLine (somevariable);
System.Console.WriteLine();
@chrisdiana
chrisdiana / gist:aa64509aa50c518c54a5
Created Sep 9, 2014
Placeholder for UITextView in Xamarin
View gist:aa64509aa50c518c54a5
// 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 => {
@chrisdiana
chrisdiana / gist:04431f0c8cf75a1e90a7
Created Sep 9, 2014
Add Done and Dismiss Keyboard for UITextView in Xamarin
View gist:04431f0c8cf75a1e90a7
// 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
View gist:cd52510b45b35634fc48
https://api.github.com/users/username/gists
View gist:48efcda21025fb3629d6
<?php
// Sample Arrays
$arrBooks = array(
"Comic" => array(
"Title" => "Superman",
"Author" => "Jerry Siegel",
"Publication Date" => "1938"),
"Science Fiction" => array(
"Title" => "Dune",
@chrisdiana
chrisdiana / gist:04f53e503a30a04649b6
Created Sep 9, 2014
Running Joomla From a Subdirectory
View gist:04f53e503a30a04649b6

Running a Joomla Site from a Subdirectory

Add to .htaccess in root directory

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/joomla/.*$
RewriteRule ^(.*)$ /joomla/$1 [QSA,L]
View monokai.vim
" Vim color file
" Converted from Textmate theme Monokai using Coloration v0.3.2 (http://github.com/sickill/coloration)
" Place this file in a directory called "colors" which should be created inside .vim folder (.vim/colors/monokai.vim)
" Then type (colorscheme monokai) into your .vimrc file
set background=dark
highlight clear
if exists("syntax_on")
syntax reset
@chrisdiana
chrisdiana / gist:5045a2322fe832fe32ca
Last active Aug 29, 2015
Text Box Validation for UITextView in Xamarin
View gist:5045a2322fe832fe32ca
// 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)) {
@chrisdiana
chrisdiana / gist:39b8a7da06c1da5ce14f
Last active Aug 29, 2015
Text Field Validation for UITextField in Xamarin
View gist:39b8a7da06c1da5ce14f
// 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 ( () => {
@chrisdiana
chrisdiana / gist:f94ec118cbbca52ccda4
Created Sep 15, 2014
Function to Get First Paragraph in Page
View gist:f94ec118cbbca52ccda4
<?php
function getFirstPara($string){
$string = substr($string,0, strpos($string, "</p>")+4);
return $string;
}
echo getFirstPara($texthere);
?>