Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Web.Http.Dependencies;
using Ninject;
using Ninject.Syntax;
public class NinjectDependencyScope : IDependencyScope
{
private IResolutionRoot resolver;
@hossambarakat
hossambarakat / git.config
Created July 18, 2013 15:43 — forked from NickJosevski/git.config
Beyond Compare Git Config
## .gitconfig
[alias]
dt = difftool
mt = mergetool
[diff]
tool = bc3
[difftool]
prompt = false
[difftool "bc3"]
script type="text/javascript">
simpleAJAXLib = {
init: function () {
this.fetchViaJSONP('your_url_goes_here');
},
fetchViaJSONP: function (url) {
url += '?format=jsonp&jsonp_callback=simpleAJAXLib.handleResponse';
document.getElementsByTagName('body')[0].appendChild(this.jsTag(url));
},
using System;
using Xamarin.Forms;
using System.Collections;
namespace YourNamespace.Views.Controls {
public class BindablePicker : Picker
{
public BindablePicker()
{
this.SelectedIndexChanged += OnSelectedIndexChanged;
Function Set-ConnectionString{
[CmdletBinding(SupportsShouldProcess=$True)]
Param(
[string]$fileName="app.config",
[string]$connectionStringName,
[string]$connectionString
)
$config = [xml](Get-Content -LiteralPath $fileName)
module BuildHelpers
open Fake
open Fake.XamarinHelper
open System
open System.IO
open System.Linq
let Exec command args =
let result = Shell.Exec(command, args)
#r @"Tools/FAKE/tools/FakeLib.dll"
#load "Tools/build-helpers.fsx"
#load "Tools/hockey-app-helpers-mac.fsx"
open Fake
open System
open System.IO
open System.Linq
open System.Text.RegularExpressions
open BuildHelpers
@hossambarakat
hossambarakat / AnimationNavigationRenderer.cs
Last active August 31, 2015 13:12 — forked from alexlau811/AnimationNavigationRenderer.cs
A custom renderer to set custom animation for NavigationPage.PushAsync and NavigationPage.PopAsync on iOS with Xamarin Forms.
[assembly: ExportRenderer(typeof(NavigationPage), typeof(AnimationNavigationRenderer))]
class AnimationNavigationRenderer : NavigationRenderer
{
public override void PushViewController(UIViewController viewController, bool animated)
{
if (animated)
{
// Alternative way with different set of trannsition
/*
using System;
namespace RsaKeyConverter.Converter
{
public static class BytesExtensions
{
public static string ToBase64(this byte[] bytes)
{
return Convert.ToBase64String(bytes);
}
@hossambarakat
hossambarakat / XXTea.cs
Created November 29, 2015 22:31 — forked from lski/XXTea.cs
A c# implementation of XXTea encryption algorithm based on the javascript version by Chris Veness
using System;
using System.Text;
/// <summary>
/// A class for encrypting and decrypting a string into base64 format which makes it safe for transfer
/// between applications.
///
/// Reference:
/// Based upon the javascript implementation of xxtea by: Chris Veness
/// www.movable-type.co.uk/tea-block.html