Skip to content

Instantly share code, notes, and snippets.

@schlan
schlan / esb_smart_meter_stats.py
Last active July 19, 2024 21:56
Download Smart Meter stats from https://myaccount.esbnetworks.ie
#!/usr/bin/env python3
import requests
from bs4 import BeautifulSoup
import re
import json
from datetime import datetime, timedelta, timezone
def load_esb_data(user, password, mpnr, start_date):
s = requests.Session()
@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 December 10, 2024 09:23
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 July 14, 2024 15:15
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 {