Skip to content

Instantly share code, notes, and snippets.

View ryanotella's full-sized avatar

Ryan ryanotella

  • NSW Department of Education
  • Sydney, Australia
View GitHub Profile
@ryanotella
ryanotella / example.txt
Created May 21, 2025 22:51
Example Gist
Hello, this is the content of your gist!
@ryanotella
ryanotella / pim.sh
Last active October 30, 2024 14:50
Azure CLI - Self-Activate PIM Role Assignments
ROLE="User Access Administrator"
SUBSCRIPTION=$(az account show --query id -otsv)
if [ ! -z "$RESOURCE_GROUP" ]; then
SCOPE="/providers/Microsoft.Subscription/subscriptions/$SUBSCRIPTION/resourceGroups/$RESOURCE_GROUP" # Group-scoped
echo "Scope (Group): $SCOPE"
else
SCOPE="/providers/Microsoft.Subscription/subscriptions/$SUBSCRIPTION" # Subscription-scoped
echo "Scope (Subscription): $SCOPE"
CONNECTED(00000003)
---
Certificate chain
0 s:/C=AU/ST=New South Wales/L=Sydney/O=NSW Department of Education/CN=j11-lb.dev.det.nsw.edu.au
i:/C=BE/O=GlobalSign nv-sa/CN=GlobalSign Organization Validation CA - SHA256 - G2
-----BEGIN CERTIFICATE-----
MIIItzCCB5+gAwIBAgIMW3wPhcvPqPbH85MMMA0GCSqGSIb3DQEBCwUAMGYxCzAJ
BgNVBAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMTwwOgYDVQQDEzNH
bG9iYWxTaWduIE9yZ2FuaXphdGlvbiBWYWxpZGF0aW9uIENBIC0gU0hBMjU2IC0g
RzIwHhcNMTkwNTE0MjMwMTIwWhcNMjEwNzMwMDE1MTA0WjCBgjELMAkGA1UEBhMC
@ryanotella
ryanotella / checkout.js
Created December 1, 2016 04:47
fdsfdssdfsd
$('[data-duplicate-check]').on('keyup change', '.email input', _.debounce(function () {
if($email.val().length < 3) {
return;
}
$.ajax({
url: '/web/api/checkout/duplicate/email',
data: {id: $('.email').attr('data-id'), email: $email.val()}
}).done(function (data) {
$email.parent().find('.alert-box').remove();
if (!$.isEmptyObject(data)) {
@ryanotella
ryanotella / checkout.js
Created December 1, 2016 04:46
Generic field duplicate check
$('[data-duplicate-check]').on('keyup change', '[data-duplicate-check-url]', _.debounce(function () {
var $field = $(this);
if($field.val().length < 3) {
return;
}
$.ajax({
url: $field.attr('data-duplicate-check-url'),
data: {value: $field.val()}
}).done(function (data) {
$field.parent().find('.alert-box').remove();
<p>Should you have any log in issues, content issues or need clinical support, please contact <strong>[email protected]</strong>.</p>
<p>For navigational help please copy and paste this link into your search engine
<em>http://eremote.crana.org.au/moodle/site_wide_files/UserGuide_eRemote_Vxx.pdf</em></p>
<p>This will take you to a user guide to be printed or saved to your computer to help you navigate around the
program.</p>
{% endif %}
<p>Regards,</p>
<p>eRemote Coordinator<br>
@ryanotella
ryanotella / Contact.php
Last active December 3, 2015 01:29
Order Customer Selector with optional exclusion of archived contacts
<?php
class Contact
{
/* @var Order[] */
private $orders;
/** @var bool */
private $deleted;
@ryanotella
ryanotella / entity-health.php
Created April 30, 2015 05:17
Hydrate all entities in the system
<?php
$doctrine = ...;
foreach ($entities as $entity) {
$metadata = $doctrine->getEntityManager()->getClassMetadata($entity);
$query = $doctrine->getEntityManager()->getRepository($entity)->createQueryBuilder('o');
foreach ($metadata->getAssociationMappings() as $association) {
$query->setFetchMode($entity, $association, 'EAGER');
}
try {
@ryanotella
ryanotella / google-drive-restore.php
Last active August 29, 2015 14:19
Using Google Drive API to restore files removed from shared folders
<?php
/**
* Requires "google/apiclient"
*/
class GoogleDriveRestore
{
/** @var Google_Client */
private $client;
@ryanotella
ryanotella / error.log
Created March 6, 2015 02:52
MySQL error frequency
[2015-02-11 08:31:02] request.CRITICAL: Uncaught PHP Exception PDOException: "SQLSTATE[HY000] [2003] Can't connect to MySQL server on '127.0.0.1' (111)" at .../vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php line 40 {"exception":"[object] (PDOException(code: 2003): SQLSTATE[HY000] [2003] Can't connect to MySQL server on '127.0.0.1' (111) at .../vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:40)"} {"token":"-daed1082","user":"Anonymous"}
[2015-02-11 08:31:02] request.CRITICAL: Uncaught PHP Exception PDOException: "SQLSTATE[HY000] [2003] Can't connect to MySQL server on '127.0.0.1' (111)" at .../vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php line 40 {"exception":"[object] (PDOException(code: 2003): SQLSTATE[HY000] [2003] Can't connect to MySQL server on '127.0.0.1' (111) at .../vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:40)"} {"token":"-daed0da1","user":"Anonymous"}
[2015-02-11 08:31:05] request.CRITICAL: Uncaught PHP Exception PDOException: