Asks for admin privileges via macOS security dialog and writes in the /etc/sudoers
file this string:
youruser ALL=(ALL) NOPASSWD:ALL
allowing you to execute next sudo
commands without asking for password via terminal.
FROM php:7.1-fpm | |
RUN set -ex && \ | |
apt-get update && \ | |
apt-get -y --no-install-recommends install \ | |
apt-utils \ | |
unzip \ | |
nano \ | |
git |
const aws = require('aws-sdk'); | |
aws.config.loadFromPath('aws.json'); | |
const locale = 'it-IT'; | |
const fs = require('fs'); | |
const pollyClient = new aws.Polly({ | |
signatureVersion: 'v4', | |
region: 'eu-west-1' |
<?php | |
namespace App\Libraries\OAuth; | |
class ImplicitGrantWithPostmessage extends \League\OAuth2\Server\Grant\ImplicitGrant | |
{ | |
public function completeAuthorizationRequest(\League\OAuth2\Server\RequestTypes\AuthorizationRequest $authorizationRequest) { | |
$response = parent::completeAuthorizationRequest($authorizationRequest); | |
$reflectionClassResponse = new \ReflectionClass($response); |
#!/bin/sh | |
while (true); do | |
inotifywait . -m -r -e create -e modify -e move -e delete | |
./execute-command.sh | |
done |
const Client = require('castv2-client').Client; | |
const Spotify = require('./Spotify'); | |
const mdns = require('mdns'); | |
const browser = mdns.createBrowser(mdns.tcp('googlecast')); | |
browser.on('serviceUp', function(service) { | |
console.log('found device "%s" at %s:%d', service.txtRecord.fn, service.addresses[0], service.port); | |
if (service.txtRecord.fn === process.env.SPOTFIY_DEVICE) { | |
ondeviceup(service.addresses[0], service.txtRecord.fn); |
<?php | |
add_action('wp_loaded', function() { | |
remove_post_type_support('posts', 'comments'); | |
remove_post_type_support('posts', 'trackbacks'); | |
add_filter('comments_array', function() { return []; }, 20, 2 ); | |
add_filter('comments_open', function() { return false; }, 20, 2 ); | |
add_filter('pings_open', function() { return false; }, 20, 2 ); | |
if (is_admin()) { | |
add_action('admin_menu', function() { |
version: '3' | |
networks: | |
proxy: | |
external: | |
true | |
services: | |
app: | |
image: [IMAGE] |
<?php | |
add_filter('wp_get_attachment_url', function($url) { | |
if (getenv('USE_S3_UPLOADS')) { | |
$url = 'https://' . getenv('AWS_S3_BUCKET') . '.s3.amazonaws.com' . str_replace(WP_CONTENT_URL, '', $url); | |
} | |
return $url; | |
}); | |
add_filter('wp_calculate_image_srcset', function($sources) { |
<?php | |
/* | |
By default, wordpress create thumbnails of uploaded media, but doesn't resize the original one. | |
With this simple hook, original image (only jpg allowed) will be resized and compressed | |
*/ | |
add_action('wp_handle_upload', function($data) { | |
$max_width = 1800; | |
$max_height = 1800; |