Skip to content

Instantly share code, notes, and snippets.

@Rarst
Rarst / RoboFile.php
Last active December 1, 2019 19:41
Robo command to build a release zip for Composer package.
<?php
class RoboFile extends \Robo\Tasks {
/**
* Creates release zip
*
* @param string $package Composer package in vendor/name format.
* @param string $version Version to build.
*/
fernando@fernando-Vostro-5470:~$ curl start.spring.io
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Initializr :: https://start.spring.io
@Maximilianos
Maximilianos / class-templater.php
Created February 12, 2016 14:51
Register custom page templates in WordPress programmatically in a plugin or in the theme without even requiring real template files.
<?php
/**
*
*/
/**
* Class MCF_Templater
*
* Based on work by Harri Bell-Thomas <https://github.com/HarriBellThomas>
@odan
odan / xampp_php7_xdebug.md
Last active April 17, 2024 05:36
Installing Xdebug for XAMPP
@andyshinn
andyshinn / composer.json
Last active February 18, 2024 12:05
Docker Compose PHP Composer Example
{
"require": {
"mfacenet/hello-world": "v1.*"
}
}
@nmackenzie
nmackenzie / LoadBalancedVM.ps1
Created October 25, 2015 19:23
Create a load-balanced pair of Azure VMs
$testName = "lower-case-unique-name"
$resourceGroupName = $testName
$location = "westus"
$domainName = $testName
$subnetName = "Subnet-1"
$publisher = "MicrosoftWindowsServer"
$offer = "WindowsServer"
$sku = "2012-R2-Datacenter"
@petenelson
petenelson / rest-api-restrict-media-endpoint.php
Created July 17, 2015 02:48
WordPress REST API: Restrict access to the media endpoint to only authenticated users
<?php
// restrict access to the media endpoint
add_action( 'init', function() {
// _add_extra_api_post_type_arguments() in the WP REST API sets this to true
// we'll turn it off for unauthenticated requests
global $wp_post_types;
$wp_post_types['attachment']->show_in_rest = is_user_logged_in();
@frntn
frntn / gist:f25726df962fc29c6dde
Last active November 1, 2023 15:18
azure-cli cheatsheet
azure
account
list [options] #List the imported subscriptions
show [options] [subscriptionNameOrId] #Show details about a subscription
set [options] <subscriptionNameOrId> #Set the current subscription
clear [options] #Remove a subscription or environment, or clear all of the stored account and environment info
import [options] <file> #Import a publishsettings file or certificate for your account
download [options] #Launch a browser to download your publishsettings file
env... #Commands to manage your account environment
@clemp6r
clemp6r / AzureStorageDeployTask.groovy
Last active May 11, 2021 05:34
Gradle task for deploying a file to Azure Blob Storage
package com.github.clemp6r.azuregradle
import org.gradle.api.DefaultTask
import com.microsoft.azure.storage.*;
import com.microsoft.azure.storage.blob.*
import org.gradle.api.tasks.TaskAction;
class AzureStorageDeployTask extends DefaultTask {
@wdullaer
wdullaer / install.sh
Last active April 2, 2024 20:33
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"