This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage ./temperature_cron.sh $HOME/pi-temp-log | |
timestamp=`date +%F` | |
temp=`/opt/vc/bin/vcgencmd measure_temp` | |
temp=${temp:5:16} | |
mkdir -p $1 # make sure dir exists | |
echo "$(date +%H:%M:%S) = $temp" >> $1/temperature_log_$timestamp.txt # create new file for each day. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array.from(document.getElementsByClassName('attachment_download')).forEach(function(elem) { | |
setTimeout(() => { | |
elem.click(); | |
}, key * 2000 ) | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!bin/bash | |
# | |
# NOTE:This file takes param as site name for | |
# | |
# This script currenty only works with easyengine. | |
# | |
# What this does essentially is clones mu-plugin repo of vip-mu-plugins-public | |
# and write nginx rule to handle static files via php. | |
# | |
# WARNING: This does not match extact vip go environment like php version and stuff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'amp_extract_image_dimensions_batch', function ( $dimensions ) { | |
$home_url = get_home_url(); | |
foreach ( $dimensions as $url => &$data ) { | |
if ( false !== strpos( $url, $home_url ) ) { | |
$attachment_id = wpcom_vip_attachment_url_to_postid( $url ); | |
if ( false !== $attachment_id ) { | |
$src = wp_get_attachment_image_src( $attachment_id ); | |
$height = $src[1]; | |
$width = $src[2]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
addEventListener('fetch', event => { | |
event.respondWith(handleRequest(event.request)) | |
}) | |
/** | |
* Respond to the request | |
* @param {Request} request | |
*/ | |
async function handleRequest(request) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Utkarsh\Attachment\Meta; | |
const META_NAME = 'media_credit'; | |
/** | |
* Bootstrap. | |
*/ | |
function bootstrap() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var anchors = document.querySelectorAll('a'); | |
var hosts = new Set(); | |
anchors.forEach((anch) => { | |
hosts.add(anch.hostname); | |
}); | |
console.table(Array.from(hosts)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function notifynet(){ | |
isdown=0 | |
echo "Pres CTRL+C to stop..." | |
while : | |
do | |
sleep 5 | |
if [ $(ping -q -c 1 -W 1 8.8.4.4 >/dev/null) ]; then | |
echo -n "1" | |
if [ $isdown -eq 1 ]; then | |
isdown=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The Demo class. | |
* | |
* @package xyz | |
*/ | |
namespace UtkarshPatel\Demo | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cask 'easyengine' do | |
version '4.0.0' | |
homepage 'https://easyengine.io/' | |
url 'https://github.com/EasyEngine/easyengine/releases/download/v4.0.0/easyengine.phar' | |
sha256 '5d7f7ec95911883240717458024f0e7c69309f7bd3646353a0594e1b0900eaa6' | |
name 'Easyengine' | |
depends_on formula: 'php' | |
depends_on cask: 'docker' | |
container type: :naked |