Skip to content

Instantly share code, notes, and snippets.

@DragonBe
DragonBe / azure-ad-connect.php
Last active Sep 14, 2022
A simple PoC to access Azure AD for authentication
View azure-ad-connect.php
<?php
declare(strict_types=1);
use League\OAuth2\Client\Provider\GenericProvider;
use Microsoft\Graph\Graph;
use Microsoft\Graph\Model;
const APP_SESS_ID = 'AZPHPSID';
const OAUTH_APP_ID = '';
@muxcmux
muxcmux / version.rake
Created Feb 12, 2012
Manage your rails app version with this rake task
View version.rake
def valid? version
pattern = /^\d+\.\d+\.\d+(\-(dev|beta|rc\d+))?$/
raise "Tried to set invalid version: #{version}".red unless version =~ pattern
end
def correct_version version
ver, flag = version.split '-'
v = ver.split '.'
(0..2).each do |n|
v[n] = v[n].to_i