Skip to content

Instantly share code, notes, and snippets.

View ThorstenHans's full-sized avatar

Thorsten Hans ThorstenHans

View GitHub Profile
@ThorstenHans
ThorstenHans / InstallAndCreateAddOn.bash
Last active August 29, 2015 13:55
Installing yeoman and generator-sharecoffee-addon
# Ensure that nodejs is installed on your system
# Install yeoman globally
npm install yo -g
# on unix systems or macs you should use sudo when installing global packages
sudo npm install yo -g #MAC/LINUX
# Install generator globally
npm install generator-sharecoffee-addon -g
@ThorstenHans
ThorstenHans / ArraysAndObjects.coffee
Last active August 29, 2015 13:56
Introduction to CoffeeScript
myObject =
foo: 'bar'
isThisAwesome: true
requiresLessKeystrokes: true
complex:
ifYouAreInterestedIn: true
stillReadable: true
caption: 'CoffeeScript'
compilesTo: 'JavaScript'
cost: 0
# install sass on windows
gem install sass
# ensure root permissions on -ix systems using sudo
sudo gem install sass
# check the installation by querying for the current SASS version
sass -v
@ThorstenHans
ThorstenHans / Sample.coffee
Last active August 29, 2015 13:56
ShareCoffee.UserProfiles
window.MyAngularApp.service 'userProfilesService', ['$http', ($http) ->
loadMyProfile: (onSuccess, onError) ->
$http ShareCoffee.REST.build.read.for.angularJS
url: ShareCoffee.Url.GetMyProperties
.success onSuccess
.error onError
loadProfilePropertiesForUser: (accountName, onSuccess, onError) ->
properties = new ShareCoffee.UserProfileProperties(ShareCoffee.Url.GetUserProfileProperty, accountName, 'WorkEmail')
@ThorstenHans
ThorstenHans / appweburl.js
Last active August 29, 2015 13:56
ShareCoffee0011
// Load the AppWebUrl (default implementation)
var appWebUrl = ShareCoffee.Commons.getAppWebUrl();
// provide a custom load function for loading the AppWebUrl
ShareCoffee.Commons.loadAppWebUrlFrom = function(){
$.ajax({url: 'Context/AppWebUrl', type: 'GET', async: false}).responseJSON;
};
var appWebUrl = ShareCoffee.Commons.getAppWebUrl();
internal class ContactsRepository : IContactsRepository<IContact>
{
private ExchangeClient _exchangeClient;
private const string ExchangeResourceId = "https://outlook.office365.com";
private const string ExchangeServiceRoot = "https://outlook.office365.com/ews/odata";
private const int PageSize = 50;
private async Task<ExchangeClient> EnsureExchangeClient()
{
if (_exchangeClient != null)
@ThorstenHans
ThorstenHans / myspcontext.js
Last active August 29, 2015 14:02
MVC SharePointContext
(function (window, undefined) {
"use strict";
var $ = window.jQuery;
var document = window.document;
// SPHostUrl parameter name
var SPHostUrlKey = "SPHostUrl";
@ThorstenHans
ThorstenHans / AppDelegate.cs
Last active August 29, 2015 14:06
Xamarin.Forms MasterDetailPage
using Xamarin.Forms;
[Register ("AppDelegate")]
public partial class AppDelegate : UIApplicationDelegate
{
UIWindow window;
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
Forms.Init ();
@ThorstenHans
ThorstenHans / Search.Sample.js
Last active August 29, 2015 14:08
ShareCoffee Search Sample
// pass querytext, selectproperties, querytemplate to the ctor
var properties = new ShareCoffee.QueryProperties();
// or set them directly on the properties object
properties.queryText = "Office 365";
properties.rowLimit = 100;
properties.startRow = 50;
// either set on properties Object or use jQuery's API chain
properties.onSuccess = function(data){
@ThorstenHans
ThorstenHans / main.css
Created May 11, 2015 12:57
saarcamp win fix
a{
margin-right:0px;
}