Skip to content

Instantly share code, notes, and snippets.

{
"token_endpoint": "https://login.microsoftonline.com/e904fb52-a46f-4d6b-ad97-6dc605bf3879/oauth2/v2.0/token",
"token_endpoint_auth_methods_supported": [
"client_secret_post",
"private_key_jwt",
"client_secret_basic"
],
"jwks_uri": "https://login.microsoftonline.com/e904fb52-a46f-4d6b-ad97-6dc605bf3879/discovery/v2.0/keys",
"response_modes_supported": [
"query",
@Krizzzn
Krizzzn / sid.js
Last active May 24, 2024 09:57 — forked from vesse/sid.coffee
Convert binary buffer object SID to string
/*
# Convert binary encoded object SID to a string
# (eg. S-1-5-21-1004336348-1177238915-682003330-512)
#
# SID format: https://technet.microsoft.com/en-us/library/cc962011.aspx
#
# ldapjs `searchEntry` has attribute `raw` that holds the raw
# values, including the `objectSid` buffer when one exists. Pass that
# buffer to get the string representation that can then be easily
# used in LDAP search filters, for example.
@Krizzzn
Krizzzn / Event.cs
Last active August 29, 2015 14:28
Sfdc Toolkit Test
namespace Salesforce.Force.FunctionalTests.Models
{
public class Event
{
public string Id { get; set; }
public string Description { get; set; }
public string Subject { get; set; }
public string WhatId { get; set; }
public DateTimeOffset? ActivityDate { get; set; }
}
@Krizzzn
Krizzzn / ExtractFirstColumn.cs
Last active August 29, 2015 14:18
A scriptcs file for opening a bunch of excel files, reading the first column and putting it into a txt file.
// A scriptcs (http://scriptcs.net/) file for opening a bunch of excel files, reading the first column and putting the content into a txt file.
//
// Needs the Microsoft.Office.Interop.Excel.dll to be in the same directory as the script.
// Copy it there by using `>copy C:\Windows\assembly\GAC_MSIL\Microsoft.Office.Interop.Excel\14.0.0.0__71e9bce111e9429c\Microsoft.Office.Interop.Excel.dll`
#r "Microsoft.Office.Interop.Excel.dll"
using System.IO;
using Microsoft.Office.Interop.Excel;
using System.Linq;
@Krizzzn
Krizzzn / calendarweek.cs
Created January 7, 2014 12:33
2013-12-31 and 2014-1-1 should both be CW1, 2014, but aren't. Happens in .NET 2.0 and 4.0
public void WrongCalendarWeekCalculation()
{
var calendar = new System.Globalization.CultureInfo("en-US").Calendar;
var m1 = calendar.GetWeekOfYear(new DateTime(2013, 12, 31), System.Globalization.CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday);
var m2 = calendar.GetWeekOfYear(new DateTime(2014, 1, 1), System.Globalization.CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday);
Console.Write("m1= {0}; m2= {1}", m1, m2); //> m1= 53; m2= 1;
}
@Krizzzn
Krizzzn / gist:7483266
Last active December 28, 2015 09:59 — forked from leggetter/gist:769688
private string GetDocumentContents(System.Web.HttpRequestBase Request){
using (Stream receiveStream = Request.InputStream)
{
using (StreamReader readStream = new StreamReader(receiveStream, Encoding.UTF8))
return readStream.ReadToEnd();
}
}
#!/bin/sh
#aktualisiert DNS-Einträge bei HostEurope
#HostEurope-Zugangsdaten
KUNDENNR=xxx
PASSWORD=xxx
#Host-ID des eigentlichen Eintrages
HOSTID=xxx
#externe IP bestimmen und dann vergleichen
@Krizzzn
Krizzzn / UploadFilesFromCurrentFolder.cs
Last active December 25, 2015 04:39
Upload one or many files to Sharepoint
using System.Net;
WebClient webClient = new WebClient();
webClient.Credentials = new NetworkCredential("*******", "********");
Action<string> act = (imageName) => {
Console.Write("uploading " + imageName + " ");
webClient.Headers.Add("Overwrite", "T");
webClient.UploadFile("http://*************/User%20Photos/Profile%20Pictures/" + imageName, "PUT", imageName);
Console.WriteLine("Done");
@Krizzzn
Krizzzn / Cheater.markdown
Last active December 14, 2015 22:39
Git Cheatsheet

checkout single file from any commit

>git show HEAD~4:index.html > oldIndex.html
-or-
>git show a7063efcd:index.html > oldIndex.html
-or-
>git checkout <branch_name> index.html

rebasing

@Krizzzn
Krizzzn / sfdc-authenticator.markdown
Created September 8, 2012 10:55
Salesforce.com Launcher

Gives you fast access to salesforce.com by storing your credentials securely onto your mobile device. A single tap gives you access to your salesforce environment without ever having to type your password again. The app is able to manage as many salesforce credentials as you like.

  • Browse salesforce in Safari with just one tap.
  • Encrypts your credentials before storing them onto your device.
  • Connects to the sfdc productive and sandbox environments.
  • Universal App - supports iPad and iPhone