View DateFormat.js
/*
* Date Format 1.2.3
* (c) 2007-2009 Steven Levithan <stevenlevithan.com>
* MIT license
*
* Includes enhancements by Scott Trenda <scott.trenda.net>
* and Kris Kowal <cixar.com/~kris.kowal/>
*
* Accepts a date, a mask, or a date and a mask.
* Returns a formatted version of the given date.
View .tfignore
# User-specific files
*.suo
*.user
*.sln.docstates
# Build results
bin
obj
#include nuget executable
View Initialize.cs
[TestClass]
public class Initalize
{
[AssemblyInitialize]
public static void InitializeDbContext(TestContext context)
{
// Connection string in app.config should use LocalDb, EG:
// <add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;AttachDbFilename=|DataDirectory|\DefaultConnection.mdf;Initial Catalog=DefaultConnection;Integrated Security=True" providerName="System.Data.SqlClient" />
AppDomain.CurrentDomain.SetData("DataDirectory", context.TestDeploymentDir);
Database.SetInitializer(new DropCreateDatabaseAlways<ApplicationDbContext>());
View KeyboardAnimation.m
///
/// Category to help with animating UIView instances
///
@implementation UIView (Animation)
-(void)translateX:(float)x andY:(float)y
{
CGPoint center = self.center;
center.x += x;
center.y += y;
View ResignOnReturnDelegate.m
@interface ResignOnReturnDelegate : NSObject <UITextFieldDelegate>
@end
@implementation ResignOnReturnDelegate
-(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
if ([string isEqualToString:@"\n"]) {
View RoundedTableView.m
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
if ([cell respondsToSelector:@selector(tintColor)]) {
if (tableView == self.tableView) {
CGFloat cornerRadius = 5.f;
cell.backgroundColor = UIColor.clearColor;
CAShapeLayer *layer = [[CAShapeLayer alloc] init];
CGMutablePathRef pathRef = CGPathCreateMutable();
CGRect bounds = CGRectInset(cell.bounds, 10, 0);
BOOL addLine = NO;
View NSArray+WeakArray.h
//
// NSMutableArray+WeakArray.h
//
#import <Foundation/Foundation.h>
///
/// Category on NSArray that provides read methods for weak pointers
/// NOTE: These methods may scan the whole array
///
View gist:7865300
BOOL isFacebookLoggedInAndiOS6 = [SimpleSocial isFacebookAvailable];
BOOL isTwitterLoggedInAndiOS6 = [SimpleSocial isTwitterAvailable];
BOOL isSmsAvailable = [SimpleSocial isSmsAvailable];
BOOL isEmailAvailable = [SimpleSocial isEmailAvailable];
View gist:7865288
@implementation ViewControllerChild
{
// For holding the simple social instance
SimpleSocial *_simpleSocial;
// An outlet to the button, so we can show/hide only when Facebook is available
__weak IBOutlet UIButton *_shareBtn;
}
- (void)viewDidLoad
View MailExtensions.cs
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
using System.Net.Mail;
using System.Net.Mime;
/// <summary>