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
<!-- From Mathias Bynens' blog post 'Everything you always wanted to know about touch icons' (http://mathiasbynens.be/notes/touch-icons) --> | |
<!-- For third-generation iPad with high-resolution Retina display: --> | |
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="apple-touch-icon-144x144-precomposed.png"> | |
<!-- For iPhone with high-resolution Retina display: --> | |
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="apple-touch-icon-114x114-precomposed.png"> | |
<!-- For first- and second-generation iPad: --> | |
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="apple-touch-icon-72x72-precomposed.png"> |
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
private void Window_Loaded( object sender, RoutedEventArgs e ) { | |
container.Measure( new Size( Double.PositiveInfinity, Double.PositiveInfinity ) ); | |
this._containHeight = container.DesiredSize.Height; | |
container.Height = 0; | |
} |
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
private void SendEmail(string from, IEnumerable<string> to, string subj, string body, bool isHtml = false, SmtpClient client) { | |
MailMessage message = new MailMessage(); | |
message.From = new MailAddress( from ); | |
foreach( string copy in cc ) { | |
message.To.Add( new MailAddress( copy )); | |
} | |
message.Subject = subj; | |
message.Body = body; | |
message.IsBodyHtml = isHtml; |
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
using Cgum; // Common methods - EncryptMd5() [personal library] | |
// init: Gravatar = GetAvatar( email ) | |
public static readonly DependencyProperty GravatarProperty = | |
DependencyProperty.Register( "Gravatar", | |
typeof( BitmapImage ), | |
typeof( SingleCustomerVM ), | |
new PropertyMetadata( | |
new BitmapImage() |
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
List<List<string>> lists = new List<List<string>>() { | |
new List<string> {"Hello", "World", "7"}, | |
new List<string> {"Hello", "7", "Person"}, | |
new List<string> {"7", "7", "Hello"} | |
}; | |
List<string> common = lists.Cast<IEnumerable<string>>( | |
.Aggregate( ( a, b ) => a.Intersect( b ) ) | |
.ToList(); |
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
var list = list.Select( s => s.Replace( toReplace, replace ) ).ToArray(); |
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
private DataTable GetData( string conString, string table ) { | |
DataTable dt = new DataTable(); | |
using( SqlConnection sqlConn = new SqlConnection( conString ) ) { | |
sqlConn.Open(); | |
using( SqlCommand sqlCmd = new SqlCommand( "SELECT * FROM " + table, sqlConn ) ) { | |
using( SqlDataAdapter sqlDa = new SqlDataAdapter( sqlCmd ) ) { | |
sqlDa.Fill( dt ); | |
} | |
} |
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
# Type 'notepad $profile' to open your profile ps1 file and add | |
# This will add the file if it doesn't exist or update the | |
# last write time if it does | |
# If you get some message about not being able to run scripts then you need to type the following command and restart powershell | |
# Set-ExecutionPolicy Bypass | |
Function touch { | |
$file = $args[0] | |
if($file -eq $null) { |
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
/** | |
* Changes value to past tense. | |
* Simple filter does not support irregular verbs such as eat-ate, fly-flew, etc. | |
* http://jsfiddle.net/bryan_k/0xczme2r/ | |
* | |
* @param {String} value The value string. | |
*/ | |
Vue.filter('past-tense', function(value) { | |
// Slightly follows http://www.oxforddictionaries.com/us/words/verb-tenses-adding-ed-and-ing | |
var vowels = ['a', 'e', 'i', 'o', 'u']; |
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
# -p get all images, etc. needed to display HTML page. | |
# --mirror turns on recursion and time-stamping, sets infinite | |
# recursion depth and keeps FTP directory listings | |
# --html-extension save HTML docs with .html extensions | |
# --convert-links make links in downloaded HTML point to local files. | |
wget --mirror -p --html-extension --convert-links www.example.com |
OlderNewer