Skip to content

Instantly share code, notes, and snippets.

@DragonBe
DragonBe / azure-ad-connect.php
Last active November 20, 2023 11:24
A simple PoC to access Azure AD for authentication
<?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 February 12, 2012 02:53
Manage your rails app version with this rake task
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