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 easy_thumbnails.models import Source, Thumbnail | |
from django.db import models | |
from django.db.models.signals import pre_delete, pre_save | |
from project_package import settings | |
class Project(models.Model): | |
name = models.CharField("Name", max_length=255) | |
main_image = models.ImageField("Main Image", blank=True, null=True, upload_to='uploads') | |
def __unicode__(self): |
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 adminsortable.models import Sortable | |
from django.template.defaultfilters import slugify | |
class Project(Sortable): | |
name = models.CharField("Name", max_length=255) | |
slug = models.SlugField(max_length=255, editable=False) | |
def save(self, *args, **kwargs): | |
self.slug = slugify(self.name) | |
super(Project, self).save(*args, **kwargs) |
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
public async Task<IEnumerable<Conversation>> GetUserConversations(string userId) | |
{ | |
var temp = await conversationRepo.GetDbSet() | |
.Where(x => x.DeletedBy != userId) | |
.Where(x => x.SellerId == userId || x.BuyerId == userId) | |
.Select(x => new | |
{ | |
conversation = x, | |
buyer = x.Buyer, | |
seller = x.Seller, |
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
[TestMethod] | |
public async Task SendMessage_Should_SaveData_AndReachPeer() | |
{ | |
IHubProxy proxy1 = await CreateConnectionAndGetProxy(AdminToken); | |
IHubProxy proxy2 = await CreateConnectionAndGetProxy(UserToken); | |
ChatMessageDTO pushedMessage = new ChatMessageDTO(); | |
proxy1.On<ChatMessageDTO>("AddNewMessage", m => pushedMessage = m); | |
ChatMessageEntryDTO message = new ChatMessageEntryDTO |
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 System; | |
using Xamarin.Forms.Platform.iOS; | |
using Xamarin.Forms; | |
using UIKit; | |
using System.Diagnostics; | |
[assembly: ExportRenderer(typeof(SearchBar), typeof(Namespace.iOS.Renderers.ExtendedSearchBarRenderer))] | |
namespace Namespace.iOS.Renderers | |
{ |
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 System; | |
using Acr.UserDialogs; | |
using Android.App; | |
using Android.Content; | |
using Android.Content.Res; | |
using Android.OS; | |
using Android.Runtime; | |
using Android.Util; | |
using Plugin.CurrentActivity; |
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 Android.Graphics; | |
using Android.Media; | |
private static Bitmap ExifRotateBitmap(string filePath, Bitmap bitmap) | |
{ | |
if (bitmap == null) | |
return null; | |
var exif = new ExifInterface(filePath); | |
var rotation = exif.GetAttributeInt(ExifInterface.TagOrientation, (int)Orientation.Normal); |
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
PowerShell -File "$(ProjectDir)Update-Bundle.ps1" $(ProjectDir) $(ConfigurationName) |
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 System; | |
using CoreGraphics; | |
using Foundation; | |
using HakiOS.Ui.Extensions; | |
using UIKit; | |
// adapted from http://forums.xamarin.com/discussion/comment/23235/#Comment_23235 | |
namespace HakiOS.Ui.Utils | |
{ | |
public class AutoScrollFromKeyboard |
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
package Core.Utils.ServiceLocation | |
{ | |
public interface ILocator | |
{ | |
function RegisterConstant(value:Object, type:Class):void; | |
function Register(type:Class, contract:Class = null):void; | |
function RegisterSingleton(type:Class, contract:Class = null):void; |
OlderNewer