Skip to content

Instantly share code, notes, and snippets.

View danimalweb's full-sized avatar

Daniel Hewes danimalweb

  • Creative Dot
  • Vancouver, Canada
View GitHub Profile
<template>
<div class="ui cards" style="margin: 10px">
<div class="ui icon input" style="width: 100%">
<input type="text" placeholder="Search..." v-model="searchQuery" />
<i class="search icon"></i>
</div>
<div
class="card ui fluid"
v-for="product in searchedProducts"
:key="product.id"
@carlalexander
carlalexander / expect-header-fix.php
Last active August 13, 2021 00:40
WordPress "Expect" header fix
<?php
/**
* By default, cURL sends the "Expect" header all the time which severely impacts
* performance. Instead, we'll send it if the body is larger than 1 mb like
* Guzzle does.
*/
function add_expect_header(array $arguments)
{
$arguments['headers']['expect'] = '';
@aorborc
aorborc / PushToZohoCreator.php
Last active October 18, 2023 12:09
Create Access Token using Zoho Creator API V2 and add record using PHP. Youtube Tutorial at https://www.youtube.com/watch?v=UqSsP-wz-mE
<?php
$client_id ='1000.GUPPSEH1013UZQA5SN8OAJV1DQU5FM';//Enter your Client ID here
$client_secret = '4932018fd429a4246e96d9186e77704d88d05b052a';//Enter your Client Secret here
$code = '1000.bf0e3723d718ac74660843a2128946b8.c6a7d9ce01ea879a22803f5f88bb0a6c';//Enter your Code here
$base_acc_url = 'https://accounts.zoho.com';
$service_url = 'https://creator.zoho.com';
$refresh_token = '1000.4f4b206a80c5e3e48c1cf3a55994a19c.c7c25dc7144da53c497b2d2ca834d1d0'; //Replce this with your Refresh token
$token_url = $base_acc_url . '/oauth/v2/token?grant_type=authorization_code&client_id='. $client_id . '&client_secret='. $client_secret . '&redirect_uri=http://localhost&code=' . $code;
@torian257x
torian257x / app.blade.php
Last active April 26, 2021 07:29
multi build of laravel mix with performance improvement for tailwindcss "yarn hot" -> javascript as hot, tailwind as watch
<!doctype html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- CSRF Token -->
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>{{ config('app.name', 'Laravel') }}</title>
@cvan
cvan / css-ios-pwa-viewport.css
Created April 3, 2020 22:14
CSS for env(safe-area-inset-top) for iOS "Add to Homescreen" / PWA; standalone styles
@supports (padding-top: constant(safe-area-inset-top)) {
body {
padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
}
@media (display-mode: fullscreen) {
body {
padding: 0;
}
@wpscholar
wpscholar / cypress--support--commands.js
Created January 22, 2020 21:12
Cypress setup for conditional WordPress login. (Double dashes in file names should be replaced with slashes)
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
@mrpeardotnet
mrpeardotnet / PVE-host-backup.md
Created December 17, 2019 18:03
Proxmox PVE Host Config Backup Script

Proxmox PVE Host Config Backup Script

This script can be used to backup essential configuration files from the Proxmox Virtual Enivronment (PVE) host.

The script will create backups using tar with specified backup prefix and date and time stamp in the file name. Script will also delete backups that are older then number of days specified.

Create backup script file

To create backup script that will be executed every day we can create backup script in /etc/cron.daily/ folder. We need to make it writeable by root (creator) only, but readable and executable by everyone:

touch /etc/cron.daily/pvehost-backup
@igorbenic
igorbenic / clauses.php
Last active February 21, 2024 21:34
Extending WP_Query with Custom Queries and Tables | https://www.ibenic.com/extending-wp-query-custom-queries-tables
<?php
add_filter( 'posts_clauses', 'filter_clauses', 10, 2 );
/**
* Filtering everything.
*
* @param array $clauses Array with all parts of the query.
* @param WP_Query $wp_query Object.
* @return string
@edwardlorilla
edwardlorilla / index.html
Created November 8, 2018 01:30
multiple filter vuejs
<div id="app">
<fieldset>
<legend>price</legend>
{{start}}
<input type="range" v-model="start" :min="min" :max="max" >
{{end}}
<input type="range" v-model="end" :min="min" :max="max">
</fieldset>
<fieldset>
<legend>color</legend>
@kierzniak
kierzniak / functions.php
Last active May 25, 2018 15:15
Require basic authentication for all pages except home page
<?php
/**
* Require basic authentication for all pages except home page
*
* @return void
*/
function motivast_require_auth() {
define('AUTH_USER', 'admin');